I am doing the coding for OCR, and found only 2 pages OCRd when I pass an original pdf with more then 2 pages.
Below is the code:
Code: Select all
PDFXOCR_Funcs.PXO_Options Options = new PDFXOCR_Funcs.PXO_Options();
Options.blacklist = string.Empty;
Options.whitelist = string.Empty;
Options.raster_dpi = 300;
Options.ImageFlags = (uint)PDFXOCR_Funcs.OCR_ImageProcessingFlags.OCR_Image_NoRotate;
Options.DataPath = m_Datapath;
Options.lang = m_Language;
Options.RegionMode = PDFXOCR_Funcs.OCR_RegionMode.OCR_Block;
Options.reserved = 0;
IntPtr pxoPagelist = IntPtr.Zero;
hResult = PDFXOCR_Funcs.OCR_MakeSearchable(pdf, ref Options, pxoPagelist);
if (PDFXOCR_Funcs.IS_DS_FAILED(hResult))
{
result += "Error running searchable.\nError code: " + hResult.ToString();
}
else
{
OCRretcode = hResult.ToString();
}
hResult = PDFXOCR_Funcs.OCR_SaveW(pdf, m_DestFilename);
if (PDFXOCR_Funcs.IS_DS_FAILED(hResult))
{
result += "Error saving output PDF file.\nError code: " + hResult.ToString();
}
PDFXOCR_Funcs.OCR_Delete(out pdf);