LEADTOOLS Support
Document
Document SDK Questions
Convert Pdf To searchable PDF with ImageOverText=True
#1
Posted
:
Monday, July 25, 2016 7:22:27 AM(UTC)
Groups: Registered
Posts: 40
Thanks: 5 times
It's possible to convert an raster pdf to searchable pdf maintaining the original format using leadtools v19 demo on .NET (similar to PdfDocumentOptions: ImageOverText=True)?
I'm using this code but original image is not perserved:
IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false);
ocrEngine.Startup(null, null, null, null);
ocrEngine.AutoRecognizeManager.Run("input.pdf", "output.pdf", DocumentFormat.Pdf, null, null);
Thanks in advance
#2
Posted
:
Tuesday, July 26, 2016 4:32:07 AM(UTC)
Groups: Manager, Tech Support, Administrators
Posts: 218
Was thanked: 12 time(s) in 12 post(s)
You need to set the ImageOverText property of the DocumentWriter's PDFDocumentOptions to true prior to the AutoRecognizeManager.Run method like so:
IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false);
ocrEngine.Startup(null, null, null, null);
PdfDocumentOptions pdfOptions = ocrEngine.DocumentWriterInstance.GetOptions(DocumentFormat.Pdf) as PdfDocumentOptions;
pdfOptions.ImageOverText = true;
ocrEngine.DocumentWriterInstance.SetOptions(DocumentFormat.Pdf, pdfOptions);
ocrEngine.AutoRecognizeManager.Run("input.pdf", "output.pdf", DocumentFormat.Pdf, null, null);
Here is some more information on the PDF Document Options and the Image Over Text Mode:
https://www.leadtools.com/help/leadtools/v19/dh/ft/leadtools.forms.documentwriters~leadtools.forms.documentwriters.pdfdocumentoptions.html
https://www.leadtools.com/help/leadtools/v19/dh/ft/leadtools.forms.documentwriters~leadtools.forms.documentwriters.pdfdocumentoptions~imageovertextmode.html
Also, there is a How To post about the various PDF Options that you can modify/change at this forum post:
http://support.leadtools.com/SupportPortal/CS/forums/44485/ShowPost.aspx
Please let me know if you have any further questions!
Hadi Chami
Developer Support Manager
LEAD Technologies, Inc.
LEADTOOLS Support
Document
Document SDK Questions
Convert Pdf To searchable PDF with ImageOverText=True
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.