QAID # 17505 Published
Question / Problem:
Do Not Perform OCR on Certain Pages
Answer / Solution:
Often, OCR need not be performed for all pages. This is the case when data has been found on a first page, or a page is marked as an attachment by patchcode or other means.
The locators allow for restricting the search region (and hence the automatically performed OCR) only for the first, middle and last pages, respectively. To inhibit OCR on an arbitrary page, you need to write a short piece of script in the
BeforeProcessXDoc event, which is the first event being fired before anything else is done with the Document.
Insert the script code shown below. This script will prevent the server from performing OCR on all pages except the first one. Without OCR, locators will not extract anything on these pages.
Private Sub Document_BeforeProcessXDoc(pXDoc As CASCADELib.CscXDocument) Dim index As Long For index = 1 To pXDoc.CDoc.Pages.Count - 1 pXDoc.CDoc.Pages(index).SuppressOCR = True Next index End Sub