TIEVisionSearchablePDFGenerator.beginDocument
Declaration
procedure beginDocument(path: PAnsiChar; title: PAnsiChar; textOnly: bool32 = false); safecall;
procedure beginDocument(path: PWideChar; title: PAnsiChar; textOnly: bool32 = false); safecall;
Description
Call before adding pages to the PDF.
Parameter | Description |
path | Path and filename of the resulting PDF |
title | Title of the PDF document (which shows in the Document Properties) |
textOnly | If True, creates PDF with only one invisible text layer which can be merged with image-only PDF files |
Note:
◼A temporary file named "pdf.ttf" will be created in the Windows temp folder (it is automatically deleted)
◼A shortcut method for this is available:
CreateSearchablePDF
// 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.pdf')), 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();