PDFium Delphi Component Docs

ConfigurePdfLibrary procedure

Unit: PDFium
Sets the process-wide native initialization settings used by the next LoadLibrary call

Syntax

procedure ConfigurePdfLibrary(const Configuration: TPdfLibraryConfiguration);

Parameters

ConfigurationTPdfLibraryConfiguration

Description

ConfigurePdfLibrary stores the native initialization settings that LoadLibrary passes to FPDF_InitLibraryWithConfig when the PDFium module is first loaded

The record covers UserFontPaths, V8Isolate, V8EmbedderSlot, V8Platform, Renderer (prpAgg or prpSkia), FontBackend (pfbpFreeType or pfbpFontations), BrotliEnabled, IsolatePerDocument, and AllowMachineTime

IsolatePerDocument maps to the FPDF_LIBRARY_CONFIG version 7 m_IsolatePerDocument flag: a V8-enabled pdfium.dll then creates a dedicated v8::Isolate for every document instead of sharing one process-wide isolate. It only takes effect with a V8 build and must be combined with a nil V8Isolate

The configuration is deep-copied, including the UserFontPaths array, so later changes to the caller's record have no effect

AllowMachineTime controls the FPDF_SetSandBoxPolicy machine-time policy applied right after native initialization, and TPdfLibraryConfiguration.Hardened is the shortcut that disables it

Remarks

Example

Config := TPdfLibraryConfiguration.Hardened;
Config.Renderer := prpSkia;
ConfigurePdfLibrary(Config);

See Also

GetPdfLibraryConfiguration, PdfLibraryConfigurationSealed, PdfNativeRendererType, PdfLibraryConfigurationSupportError, TPdf.LoadLibrary, ConfigureSystemFontProvider