GetRenderCapabilities

Rendering and printing

Description

Returns JSON describing which renderer each rendering and printing operation uses, which facades export it and whether the configured Cairo and PDFium libraries can be loaded

Deployment checks can use the report to reject an unsupported facade, platform or renderer combination before calling an operation

Syntax

Delphi

function TPDFlib.GetRenderCapabilities(
  ProbeRuntime: Integer; out Info: WideString): Integer;

ActiveX

Function PDFlib::GetRenderCapabilities(ProbeRuntime As Long) As String

Available on the IPDFlibrary3 interface, the default interface of the PDFlibrary object from type library version 3.4

DLL

const wchar_t* DLGetRenderCapabilities(int InstanceID, int ProbeRuntime);
const char* DLGetRenderCapabilitiesA(int InstanceID, int ProbeRuntime);

Parameters

ProbeRuntime0 reports the configured state without loading libraries; 1 also loads the Cairo and PDFium libraries set with SetCairoFileName and SetPDFiumFileName to confirm they are still available
InfoThe JSON report; cleared when ProbeRuntime is neither 0 nor 1

Return values

Result1 when the report was produced; 0 when ProbeRuntime is invalid. The DLL functions return an empty string for an invalid ProbeRuntime and nil for an unknown instance; the ActiveX method returns an empty string for an invalid ProbeRuntime

Report fields

schemaVersion1 for this report contract
libraryVersion, platform, architecture, pointerBits, compilerIdentity of the compiled library
selectedRenderer, runtimeProbedThe renderer ID returned by SelectedRenderer and whether library loading was attempted
renderersOne entry per renderer ID with name, compiled, selected, runtime and the formats accepted as RenderPageToStream Options values
rendererSelectionFacade availability of SelectRenderer, SetCairoFileName and SetPDFiumFileName
operationsOne entry per operation with windowsOnly, usesFormat, a renderers object keyed by renderer ID, a facades object and notes

Renderer IDs are 1 for the built-in renderer, 2 for Cairo and 3 for PDFium, matching SelectRenderer

The runtime values are built-in, not-compiled, not-configured, configured, available and unavailable; configured means the library loaded when it was set and was not probed again

Operation renderer values are supported, partial (see notes), built-in-fallback (the operation always uses the built-in renderer, whatever renderer is selected) and unsupported. Renderers that are not compiled, and Windows-only operations on other platforms, report unsupported

The facade object covers delphi, dll, activex and dylib and records whether that facade exports the operation

Operation matrix

The report contains the following operations; the platform and facade columns describe the shipped facades

OperationBuilt-inCairoPDFiumPlatformDLLActiveXDylibNotes
RenderPageToStreamSupportedSupportedSupportedAllNoNoNo
RenderPageToStringSupportedSupportedSupportedAllYesNoYes
RenderPageToFileSupportedSupportedSupportedAllYesYesYes
RenderDocumentToFileSupportedSupportedUnsupportedAllYesYesYesPDFium does not write multi-page files
RenderPagesToFilesSupportedSupportedSupportedAllYesYesYes
RenderAsMultipageTIFFToFileSupportedSupportedSupportedAllYesYesYes
RenderPageToGrayscaleFileSupportedSupportedSupportedAllNoNoNo
RenderPageToMonochromeFileExSupportedSupportedSupportedAllNoNoNo
RenderPageToMemoryUnsupportedSupportedSupportedAllNoNoNo24-bit or 32-bit caller buffer filled with the whole page
RenderPageToDCSupportedSupportedSupportedWindowsYesYesYes
RenderPageToDCClipSupportedSupportedSupportedWindowsYesYesYesThe clip moves with the render offset
RenderPageRegionToFileSupportedSupportedSupportedWindowsNoNoNo
RenderPageToMetafileStreamSupportedUnsupportedUnsupportedWindowsNoNoNoCairo and PDFium produce raster output only
RenderPageToMetafileFileSupportedUnsupportedUnsupportedWindowsNoNoNoCairo and PDFium produce raster output only
RenderPageToClipboardSupportedSupportedSupportedWindowsNoNoNo
RenderPageTileToStreamSupportedSupportedSupportedAllNoNoNoPDFium renders tiles one at a time and does not apply the crop type or optional content state; on non-Windows platforms the built-in renderer draws tiles
RenderPageTileToFileSupportedSupportedSupportedAllNoNoNoPDFium renders tiles one at a time and does not apply the crop type or optional content state; on non-Windows platforms the built-in renderer draws tiles
RenderPageTilesToFilesSupportedSupportedSupportedAllNoNoNoPDFium renders tiles one at a time and does not apply the crop type or optional content state; on non-Windows platforms the built-in renderer draws tiles
RenderPageTiledToStreamSupportedSupportedSupportedAllNoNoNoPDFium renders tiles one at a time and does not apply the crop type or optional content state; on non-Windows platforms the built-in renderer draws tiles
RenderPageLayerToStreamSupportedSupportedBuilt-in fallbackAllNoNoNoPDFium cannot separate the annotation and form layers, so the built-in renderer draws them
RenderXFAPageToStreamSupportedSupportedSupportedAllNoNoNo
RenderPagesToFilesParallelSupportedSupportedSupportedAllNoNoNoPDFium is not thread-safe, so a PDFium selection renders on one worker
DARenderPageToStreamSupportedSupportedSupportedAllNoNoNo
DARenderPageToStringSupportedSupportedSupportedAllYesNoYes
DARenderPageToFileSupportedSupportedSupportedAllYesYesYes
DARenderPagesToFilesSupportedSupportedSupportedAllYesYesYes
DARenderPageToDCSupportedSupportedSupportedWindowsYesYesYesPDFium renders a snapshot that includes unsaved Direct Access edits
PrintDocumentSupportedSupportedSupportedWindowsYesYesYes
PrintPagesSupportedSupportedSupportedWindowsYesYesYes
PrintDocumentToPrinterObjectSupportedSupportedSupportedWindowsNoNoNo

From type library version 3.4 the ActiveX facade configures Cairo and PDFium through SetCairoFileName and SetPDFiumFileName on IPDFlibrary3 and reports the choice through SelectedRenderer

Scope

The operation table describes the library source and is not a per-document guarantee; a supported operation can still fail for a damaged document or an unavailable font, and LastRenderError reports the cause

A runtime probe only loads the libraries; it does not render a page

Example

var
  Info: WideString;
begin
  Lib.SetCairoFileName('cairo.dll');
  if Lib.GetRenderCapabilities(1, Info) = 1 then
    Writeln(UTF8Encode(Info));
end;

See also

SelectRenderer, SetCairoFileName, SetPDFiumFileName, GetNativeBackendCapabilities