Question
How to delete unwanted documents imported from a hot folder based on file format or type?
Answer
- Go to FlexiCapture Project > Project Properties > Workflow.
- Click the Stage button on the right to create a new stage.
- Select/Highlight Automatic, then click OK.
- Set the name for the Stage and leave Entry and Exit routes to default.
- Go to the Script tab, set it to Batch Processing, and then click Edit Script.
- 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
Comments
0 comments
Please sign in to leave a comment.