How to delete unwanted documents imported from hot folder based on file format or type?

Question

How to delete unwanted documents imported from a hot folder based on file format or type?

 

Answer

  1. Go to FlexiCapture Project > Project Properties > Workflow.
  2. Click the Stage button on the right to create a new stage.Step2.png
  3. Select/Highlight Automatic, then click OK.Step3.png
  4. Set the name for the Stage and leave Entry and Exit routes to default.
  5. Go to the Script tab, set it to Batch Processing, and then click Edit Script.
  6. In the Script Editor window place this sample script below (this script aims to delete a document that has PNG format):
    foreach (IDocument document in Batch.Documents)

       {

         foreach (IPage page in document.Pages)

             {

               string id = page.ImageSourceFileSubPath;

               string FileExt = id.Substring(id.Length - 3);

               if (FileExt == "png")

                    {

                        Batch.DeletePage(page);

                    }

              }

        }

Note: This can also be done in Batch Type properties if a custom batch type is used instead of the Default one.

Additional information

Processing scripts

 

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.