Question
How to exclude pages from recognition?
Answer
- Advanced workflow is required.
-
Create an automatic script stage before recognition for batch processing. This script should remove the pages, save them as regular files in a temporary directory, save the name of the temp files and their amount:
int from=1; // first page is 0
int to=1;
Random r = new Random();
string fileName = "d://temp"+r.Next(1000000).ToString()+"_";
//let's save the values for restoring
Batch.Properties.Set("from",from);
Batch.Properties.Set("to",count);
Batch.Properties.Set("fileName",fileName);
//save file and remove it from recognition
for(int i=from;i<count&&i<to;i++){
Documents[i].SaveAs(fileName + i.ToString() + ".jpg");
Batch.DeleteDocument(Documents[i]);
} -
Create additional automatic stage after recognition. Here you just need to load saved pages into an already recognized document:
for(int i=Batch.Properties.Get("from"); i<Batch.Properties.Get("to"); i++){
string fn = Batch.Properties.Get("fileName") + i.ToString() + ".jpg";
IEditablePictureObject img = FCTools.LoadImage(fn);
Batch.CreatePageFromImage(img,Documents[0],-1);
} -
You can see that the second page is a part of the document. The counter in the License Manager has been decreased by one.
