ImageEn, unit iesettings

TIEGlobalSettings.PDFEngine

TIEGlobalSettings.PDFEngine


Declaration

property PDFEngine: TIEImagingEngine;


Description

Specifies which engine is used to load and save PDF documents.
Property Description 32bit Requirement 64bit Requirement
ieenAuto Automatically chooses ieenDLL if the PDFium DLL is found in the EXE folder, otherwise ieenNative (Saving) or ieenLegacy (Loading) - -
ieenNative Uses native loading code (Saving only) Always Supported Always Supported
ieenDLL Uses the PDFium DLL iepdf32.dll iepdf64.dll
ieenWIC WIC does not support PDF N/A N/A
ieenLegacy Checks for a plug-in such as GhostScript or WP Tools Relevant Plug-In Relevant Plug-In
ieenNone Format is unavailable - -


Note:
This has no effect for the PdfViewer, which always uses PDFium
ieenDLL requires you to ship the PDFium DLLs with your application
With ieenAuto, only the EXE folder is searched for relevant DLLs. For ieenDLL, the system path is also checked (or specify a path by calling RegisterPlugins)
ieenWIC is not supported
You can get the active engine using ActivePDFEngine, and the status of all imaging engines using ImageEnVersion.Status

Default: ieenAuto (which uses ieenDLL if the PDFium DLL is available, otherwise ieenNative (for saving) or ieenLegacy (for loading)


Saving with Native vs PDFium

Both engines provide a similar result when saving, though each have some limitations.

Native Limitations:
Fonts cannot be embedded into the PDF (only PDF Standard Fonts can be used. Others will be substituted)

PDFium Limitations:
Meta-data is not saved (PDF_Title, PDF_Author, PDF_Subject, PDF_Keywords, PDF_Creator, PDF_Producer)
Only ioPDF_UNCOMPRESSED and ioPDF_JPEG compression methods are supported


Examples

// Use PDFium to create PDF files
IEGlobalSettings().PDFEngine := ieenDLL;


// Load a PDF as a rasterized bitmap (using PDFium), add a watermark, and then save (natively)
IEGlobalSettings().PDFEngine := ieenDLL;
bmp.LoadFromFile( 'D:\document.pdf' );
bmp.Proc.TextOut( Align_Text_Horz_Center, Align_Text_Near_Bottom, 'www.ImageEn.com', 'Arial', 32, clRed, [fsBold] );
IEGlobalSettings().PDFEngine := ieenNative;
bmp.Params.Params.PDF_Compression := ioPDF_JPEG; // or ioPDF_G4FAX for monochrome images
bmp.SaveToFile( 'D:\document_WM.pdf' );


See Also

ActivePDFEngine
ImageEnVersion.IELibVersionStr