ImageEn, unit ievision

TIEVisionSearchablePDFGenerator


Declaration

TIEVisionSearchablePDFGenerator = interface(TIEVisionBase)


Description

This interface allows you to create a multipage PDF from a set of images. OCR is performed on the images so the PDF will be searchable (and the text can be selected and copied).

Many languages are available as separate files.




Demos

Demo  Demos\IEVision\GenerateSearchablePDF\GenerateSearchablePDF.dpr


Example

// Creates a textual PDF named 'out.pdf' from the content of ImageEnMView1 using OCR
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();


Methods and Properties

Public Method  setSegmentationMode
Public Method  beginDocument
Public Method  addPage
Public Method  endDocument


See Also

Public Method  createSearchablePDFGenerator
Class  TIEVisionLanguages
Global Method  IEVisionLanguageCodeToName
Global Method  IEVisionLanguageNameToCode
Global Method  IEVisionGetLanguagesInFolder