ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Creating PDF+OCR
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Merlin

Germany
7 Posts

Posted - Mar 07 2025 :  06:51:39  Show Profile  Reply
Hello,

Is it possible to subsequently convert a PDF into a PDF with OCR content or do the pages of the PDF file have to be exported and then reassembled using TIEVisionSearchablePDFGenerator?

An example program would be great :)

Thanx

xequte

38872 Posts

Posted - Mar 07 2025 :  19:07:06  Show Profile  Reply
Sorry, do you mean that you have a PDF that contains images of text (not text itself), and you want to convert it into a PDF where the text is available (text has been OCR'ed)?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Merlin

Germany
7 Posts

Posted - Mar 10 2025 :  04:46:37  Show Profile  Reply
Hello

yes, I want to apply text recognition to a pdf file that does not contain any text. To do this, the file must be loaded, the individual pages exported as images and then the text content must be determined with the text recognition via pdfGen : TIEVisionSearchablePDFGenerator.

Hmm, maybe there's a small example available if I do not have to use external libraries for the export of the individual PDF pages.

Thanks
Go to Top of Page

xequte

38872 Posts

Posted - Mar 10 2025 :  19:46:39  Show Profile  Reply
Why not do it as follows:


// Convert "in.pdf" (pages are images) to "out.pdf" (text in pages now selectable)
ImageEnMView1.MIO.LoadFromFile( 'D:\in.pdf' );
pdfGen := IEVisionLib.createSearchablePDFGenerator('./', IEOCRLanguageList[OCR_English_language].Code);
pdfGen.beginDocument(PAnsiChar(AnsiString(langPath + 'out')), PAnsiChar(AnsiString('title')));
for i := 0 to ImageEnMView1.ImageCount - 1 do
begin
  ImageEnMView1.SelectedImage := i; // Show the image being processed
  pdfGen.addPage(ImageEnMView1.IEBitmap.GetIEVisionImage());
end;
pdfGen.endDocument();


You will need to add iepdf32.dll to your EXE folder.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Merlin

Germany
7 Posts

Posted - Mar 12 2025 :  08:20:53  Show Profile  Reply
Hello Nigel,


thank you, I will give it a try :)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: