ImageEn, unit ievision

TIEVisionSearchablePDFGenerator.addPage

TIEVisionSearchablePDFGenerator.addPage


Declaration

procedure addPage(image: TIEVisionImage; format: TIEVisionPDFImageFormat = ievPDFImgFmt_AUTO); safecall;


Description

Add a new page (using a source image). OCR is performed immediately, so this is blocking operation.

Parameter Description
image Image containing text to be OCR'ed
format Image compression format. Default is ievPDFImgFmt_AUTO

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


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();