ImageEn, unit ievision

TIEVisionSearchablePDFGenerator


Declaration

TIEVisionSearchablePDFGenerator = interface(TIEVisionBase)


Description

An interface that creates 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 supported by including relevant language DLLs.



Note:
The PDF page will be created at the size and DPI of the image (i.e. Width x Height / Dpi). You can set the DPI of the image before adding the page to scale it
A shortcut method for this is available: CreateSearchablePDF


Demos

Demo  Demos\IEVision\GenerateSearchablePDF\GenerateSearchablePDF.dpr


Example

// Create 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
Public Method  langLoaded


See Also

createSearchablePDFGenerator
TIEVisionLanguages
IEVisionLanguageCodeToName
IEVisionLanguageNameToCode
IEVisionGetLanguagesInFolder