function PdfLibraryConfigurationSupportError(const Configuration: TPdfLibraryConfiguration; SkiaBuild, FontationsBuild: Boolean): string;
| Configuration | TPdfLibraryConfiguration. The settings to check |
| SkiaBuild | Boolean. True for a PDFium build with Skia support, which exports FPDF_RenderPageSkia |
| FontationsBuild | Boolean. True for a PDFium build with the Fontations font backend |
string: empty when the configuration is supported, otherwise a description of the unsupported settingPDFium's native initialization stops the whole process when it receives a renderer or font backend that the build does not contain; it does not return an error
LoadLibrary therefore runs this check after binding the exports and before native initialization: prpSkia requires a Skia build and pfbpFontations requires a Fontations build. When the check fails, LoadLibrary unloads the library, leaves the configuration unsealed and raises EPdfError, so the application can call ConfigurePdfLibrary with other settings and retry
Skia support is detected from the FPDF_RenderPageSkia export. PDFium exports nothing for Fontations, so LoadLibrary looks for the Rust font crates that 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;