API referenceCore SDK

pdfLoadFromCanvasDC

Capture the GDI canvas created by pdfGetCanvasDC into the

C
int32_t __stdcall pdfLoadFromCanvasDC(PPDF IPDF, double DPI, int32_t Options);
int32_t __stdcall pdfNewPageFromCanvasDC(PPDF IPDF, double DPI, int32_t Options);
Delphi
function pdfLoadFromCanvasDC(const IPDF: PPDF; DPI: Double; Options: Integer): Integer; stdcall;
function pdfNewPageFromCanvasDC(const IPDF: PPDF; DPI: Double; Options: Integer): Integer; stdcall;

Purpose. Capture the GDI canvas created by pdfGetCanvasDC into the current page (pdfLoadFromCanvasDC) or onto a freshly-created new page (pdfNewPageFromCanvasDC), rasterized at DPI.

Description. Both call the same CaptureCanvasToPage(NewPage: Boolean, DPI) with only the NewPage boolean differing. Options is accepted by both but never passed through — whatever capture-mode selection it implies has no effect regardless of value.

Parameters.

ParameterDescription
IPDFDocument handle.
DPICapture resolution.
OptionsAccepted but silently dropped.

Return value. Non-zero on success; 0 if IPDF is invalid or no canvas has been created via pdfGetCanvasDC.

See also. pdfGetCanvasDC.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfLoadFromCanvasDC(IntPtr IPDF, double DPI, int Options);
Area
Core SDK
Category

Core

Exported names

pdfLoadFromCanvasDC

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.