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 and RenderPageToFile support PDFium BMP output through option 0.

- 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;