function PdfLibraryConfigurationSupportError(const Configuration: TPdfLibraryConfiguration; SkiaBuild, FontationsBuild: Boolean): string;
| Configuration | TPdfLibraryConfiguration. The settings to check |
| SkiaBuild | Boolean. True when the PDFium build has Skia support and exports FPDF_RenderPageSkia |
| FontationsBuild | Boolean. True when the PDFium build carries the Fontations font backend |
string: empty when the configuration is supported, otherwise a description of whichever setting is unsupportedPDFium's native initialisation halts the whole process when it is handed a renderer or font backend the build does not contain; it does not return an error
LoadLibrary therefore runs this check after binding the exports and before native initialisation: prpSkia requires a Skia build and pfbpFontations requires a Fontations build. Should the check fail, LoadLibrary unloads the library, leaves the configuration unsealed and raises EPdfError, so the application can call ConfigurePdfLibrary with other settings and try again
Skia support is detected from the FPDF_RenderPageSkia export. PDFium exports nothing for Fontations, so LoadLibrary looks for the Rust font crates this backend links into the library file; a library file that cannot be read is treated as not supporting it
The bundled pdfium.dll and pdfium.v8.dll are Skia builds without Fontations
prpDefault, prpAgg, pfbpDefault and pfbpFreeType are accepted by every buildConfig := GetPdfLibraryConfiguration;
Config.Renderer := prpSkia;
ConfigurePdfLibrary(Config);
try
LoadLibrary;
except
on E: EPdfError do
begin
Config.Renderer := prpDefault;
ConfigurePdfLibrary(Config);
LoadLibrary;
end;
end;