コミュニティ

RECOGNIZE ONLY THE FIRST PAGE OF THE DOCUMENT

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]);
            }
        }
    }
}

 
 

この記事は役に立ちましたか?

1人中1人がこの記事が役に立ったと言っています

コメント

1件のコメント

  • Avatar
    Dmytro Bezus

    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.

    0

サインインしてコメントを残してください。