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
| ProbeRuntime | 0 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 |
|---|---|
| Info | The JSON report; cleared when ProbeRuntime is neither 0 nor 1 |
Return values
| Result | 1 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
| schemaVersion | 1 for this report contract |
|---|---|
| libraryVersion, platform, architecture, pointerBits, compiler | Identity of the compiled library |
| selectedRenderer, runtimeProbed | The renderer ID returned by SelectedRenderer and whether library loading was attempted |
| renderers | One entry per renderer ID with name, compiled, selected, runtime and the formats accepted as RenderPageToStream Options values |
| rendererSelection | Facade availability of SelectRenderer, SetCairoFileName and SetPDFiumFileName |
| operations | One 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
| Operation | Built-in | Cairo | PDFium | Platform | DLL | ActiveX | Dylib | Notes |
|---|---|---|---|---|---|---|---|---|
| RenderPageToStream | Supported | Supported | Supported | All | No | No | No | |
| RenderPageToString | Supported | Supported | Supported | All | Yes | No | Yes | |
| RenderPageToFile | Supported | Supported | Supported | All | Yes | Yes | Yes | |
| RenderDocumentToFile | Supported | Supported | Unsupported | All | Yes | Yes | Yes | PDFium does not write multi-page files |
| RenderPagesToFiles | Supported | Supported | Supported | All | Yes | Yes | Yes | |
| RenderAsMultipageTIFFToFile | Supported | Supported | Supported | All | Yes | Yes | Yes | |
| RenderPageToGrayscaleFile | Supported | Supported | Supported | All | No | No | No | |
| RenderPageToMonochromeFileEx | Supported | Supported | Supported | All | No | No | No | |
| RenderPageToMemory | Unsupported | Supported | Supported | All | No | No | No | 24-bit or 32-bit caller buffer filled with the whole page |
| RenderPageToDC | Supported | Supported | Supported | Windows | Yes | Yes | Yes | |
| RenderPageToDCClip | Supported | Supported | Supported | Windows | Yes | Yes | Yes | The clip moves with the render offset |
| RenderPageRegionToFile | Supported | Supported | Supported | Windows | No | No | No | |
| RenderPageToMetafileStream | Supported | Unsupported | Unsupported | Windows | No | No | No | Cairo and PDFium produce raster output only |
| RenderPageToMetafileFile | Supported | Unsupported | Unsupported | Windows | No | No | No | Cairo and PDFium produce raster output only |
| RenderPageToClipboard | Supported | Supported | Supported | Windows | No | No | No | |
| RenderPageTileToStream | Supported | Supported | Supported | All | No | No | No | PDFium 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 |
| RenderPageTileToFile | Supported | Supported | Supported | All | No | No | No | PDFium 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 |
| RenderPageTilesToFiles | Supported | Supported | Supported | All | No | No | No | PDFium 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 |
| RenderPageTiledToStream | Supported | Supported | Supported | All | No | No | No | PDFium 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 |
| RenderPageLayerToStream | Supported | Supported | Built-in fallback | All | No | No | No | PDFium cannot separate the annotation and form layers, so the built-in renderer draws them |
| RenderXFAPageToStream | Supported | Supported | Supported | All | No | No | No | |
| RenderPagesToFilesParallel | Supported | Supported | Supported | All | No | No | No | PDFium is not thread-safe, so a PDFium selection renders on one worker |
| DARenderPageToStream | Supported | Supported | Supported | All | No | No | No | |
| DARenderPageToString | Supported | Supported | Supported | All | Yes | No | Yes | |
| DARenderPageToFile | Supported | Supported | Supported | All | Yes | Yes | Yes | |
| DARenderPagesToFiles | Supported | Supported | Supported | All | Yes | Yes | Yes | |
| DARenderPageToDC | Supported | Supported | Supported | Windows | Yes | Yes | Yes | PDFium renders a snapshot that includes unsaved Direct Access edits |
| PrintDocument | Supported | Supported | Supported | Windows | Yes | Yes | Yes | |
| PrintPages | Supported | Supported | Supported | Windows | Yes | Yes | Yes | |
| PrintDocumentToPrinterObject | Supported | Supported | Supported | Windows | No | No | No |
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