If you need to recognize only the frist page of your document, must use this script
foreach (IDocument doc in Batch.Documents)
{
for (int i = 1; i < doc.Pages.Count; ++i)
{
IPage page = doc.Pages[i + 1];
FCTools.ShowMessage(":: Pag " + (i + 1));
Batch.DeletePage(page);
}
}
This script has to be before Recognition stage. In order to delete all pages except, the first. You can also make some changes and use Bactch properties or documents properties as this example:
var etapa = Batch.Properties.Get("stage");
if (etapa == "recepcion")
{
foreach (IDocument doc in Batch.Documents)
{
var filename = doc.Pages[0].ImageSource.ToLower();
if (filename.Contains("audatex"))
{
FCTools.ShowMessage($"Nombre de Audatex: {filename} || Pages in DocDef: {doc.Pages.Count}");
for (int i = doc.Pages.Count - 1; i > 0; --i)
{
FCTools.ShowMessage($":: Pag {i + 1}");
Batch.DeletePage(doc.Pages[i]);
}
}
}
}
Comments
1 comment
Hi Alexander,
Thanks so much for sending over your script sample! We appreciate you taking the time to share it with us. The script is well-written and could be a helpful resource in the future.
Please sign in to leave a comment.