PDFium Rendering
Version 3.9.7 adds optional PDFium rendering on Windows. The default renderer remains GDI+. Applications can call SetPDFiumFileName with the full path to pdfium.dll, then call SelectRenderer(3) to render with PDFium. SelectedRenderer returns the active backend, and SelectRenderer(1) switches back to GDI+.
Supported rendering paths
- RenderPageToStream, RenderPageToFile and RenderPagesToFiles support the same raster output options the GDI+ and Cairo renderers accept: 0 (BMP), 1 (JPEG), 5 (PNG), 6 (GIF), 7 (TIFF) and 10 (G4 TIFF). SetJPEGQuality applies to option 1, and the TIFF options honour the active GDI+ settings.
- The metafile output options (2 WMF, 3 EMF, 4 EPS, 8 EMF+, 9 HTML5, 11 EMF+ dual) have no PDFium equivalent. Those calls return 0 and LastRenderError explains which formats the PDFium backend supports.
- RenderPageToDC renders the selected page to a Windows device context using PDFium.
- RenderPageToMemory renders into caller-provided 24-bit or 32-bit memory buffers.
- PrintDocument and PrintPages use PDFium when renderer 3 is selected.
- RenderDocumentToFile multi-page output and Direct Access rendering continue to use the existing renderer paths.
Deployment notes
The PDFium DLL must match the process architecture. The distribution stores the runtime files under DLL\PDFium\Win32 and DLL\PDFium\Win64. Keep pdfium.dll together with its companion runtime DLLs when deploying an application.
Version 3.23.0 refreshes the bundled optional PDFium runtime DLL payloads under DLL\PDFium\Win32 and DLL\PDFium\Win64; the public renderer-selection API and GDI+ default are unchanged.
Delphi syntax
function TPDFlib.SetPDFiumFileName(const FileName: WideString): Integer;function TPDFlib.SelectRenderer(RendererID: Integer): Integer;function TPDFlib.SelectedRenderer: Integer;