Wrong PDF when using OCR_MakeSearchable

PDF-X OCR SDK is a New product from us and intended to compliment our existing PDF and Imaging Tools to provide the Developer with an expanding set of professional tools for Optical Character Recognition tasks

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan

Post Reply
baumunk
User
Posts: 1
Joined: Fri Nov 13, 2020 8:47 am

Wrong PDF when using OCR_MakeSearchable

Post by baumunk » Fri Nov 13, 2020 9:41 am

We test your product.
With your example application OCRDemoCsharp

Pdf contains images and text. After OCR, text in the image is searchable but text is removed.

Orignal PDF:

Image
image.png
After OCR:

Image
image1.png
What am I doing wrong?
We are using DEMO.

If I use the same function in PDF-XChange Editor it is correct.

Code:

Code: Select all

hResult = PDFXOCR.PDFXOCR_Funcs.OCR_SetCallback(pdf, thecallback, 0);

				hResult = PDFXOCR.PDFXOCR_Funcs.OCR_LoadW(pdf, m_SourceFilename);
				if (PDFXOCR.PDFXOCR_Funcs.IS_DS_FAILED(hResult))
				{
					MessageBox.Show("Error loading file: \n" + m_SourceFilename, "OCR Library Error");
					break;
				};


				PDFXOCR.PDFXOCR_Funcs.PXO_Options Options = new PDFXOCR.PDFXOCR_Funcs.PXO_Options();
				Options.blacklist = "";
				Options.whitelist = "";
				Options.raster_dpi = 300;
                Options.ImageFlags = (uint) PDFXOCR.PDFXOCR_Funcs.OCR_ImageProcessingFlags.OCR_Image_NoRotate;
				Options.DataPath = m_Datapath;
				Options.lang = m_Language;
				Options.RegionMode = PDFXOCR.PDFXOCR_Funcs.OCR_RegionMode.OCR_Auto;
				Options.SecondLanguage = 0;

				IntPtr pxoPagelist = IntPtr.Zero; // null pointer passed to OCR_MakeSearchable() will result in all pages being OCRd.

           
                hResult = PDFXOCR.PDFXOCR_Funcs.OCR_MakeSearchable(pdf, ref Options, pxoPagelist);
Regards.
Attachments
ocr_77.pdf
(633.6 KiB) Downloaded 3 times
77.pdf
(101.1 KiB) Downloaded 2 times

Post Reply