pdfGetInPrintSettings
Store/retrieve the document's declared print preferences
BOOL32 __stdcall pdfGetPrintSettings(PPDF IPDF, TPDFPrintSettings* Settings);
BOOL32 __stdcall pdfSetPrintSettings(PPDF IPDF, TDuplexMode Mode, int32_t PickTrayByPDFSize, uint32_t NumCopies, TPrintScaling PrintScaling, uint32_t* PrintRanges, uint32_t NumRanges);
BOOL32 __stdcall pdfGetInPrintSettings(PPDF IPDF, TPDFPrintSettings* Settings);
function pdfGetPrintSettings(const IPDF: PPDF; var Settings: TPDFPrintSettings): LongBool; stdcall;
function pdfSetPrintSettings(const IPDF: PPDF; Mode: TDuplexMode; PickTrayByPDFSize: Integer; NumCopies: Cardinal; PrintScaling: TPrintScaling; const PrintRanges: PCardinal; NumRanges: Cardinal): LongBool; stdcall;
function pdfGetInPrintSettings(const IPDF: PPDF; var Settings: TPDFPrintSettings): LongBool; stdcall;
Purpose. Store/retrieve the document's declared print preferences (duplex mode, tray-pick-by-page-size, copy count, print-scaling mode, and page ranges) as document metadata — consumed by an external caller building its own print dialog/job, not automatically applied by pdfPrintPage/pdfPrintPDFFile (see above).
Description. FIXED 2026-07-12 — was a verified Get/Set asymmetry. SetPrintSettingsH stores Mode/NumCopies/PickTray/Scale and marshals PrintRanges/NumRanges into a real FPrintRanges array. GetPrintSettingsH now reads all of it back: Settings.PrintScaling is set from the stored scale, and Settings.PrintRanges/NumRanges point at the real FPrintRanges array (a persisted per-document field, valid for the document's lifetime — the same ownership pattern this SDK uses for every other engine-owned pointer-out-field) instead of always reporting nil/0. Prior to the fix, TPDFPrintSettings had no field at all for PrintScaling, so there was nowhere to report it even if the getter had tried — fixed by additively extending the struct (append-only, after StructSize, so a caller built against the old 5-field layout is unaffected) with PrintScaling: TPrintScaling and NumRanges: Cardinal. pdfGetInPrintSettings is the In-prefixed sibling — its generated Status: Stub tag is STALE: the wrapper body is a real call into the same GetPrintSettingsH used by the non-In getter (with the standard NotImplLogB failure path only for an unresolvable IPDF, not as its actual behavior) — meaning, notably, **it reports the *live* document's own print settings, not any import source's** (there is no dedicated import-side print-settings storage in this SDK — pdfGetInPrintSettings and pdfGetPrintSettings are functionally identical calls despite the In-prefix naming convention implying an import-source query elsewhere in this manual).
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Mode | Duplex mode; genuinely stored and round-trips through Get. |
PickTrayByPDFSize | Genuinely stored and round-trips through Get. |
NumCopies | Genuinely stored (and echoed back by the getter) — but not applied to any real print job by this SDK's own print functions (see Printer Enumeration and Configuration's DEVMODE finding — actual multi-copy printing requires the DC's own configuration). |
PrintScaling | Genuinely stored by the setter and now genuinely read back by the getter (fixed 2026-07-12; the struct previously had no field to report it in). |
PrintRanges, NumRanges | Genuinely stored by the setter into FPrintRanges, and now genuinely read back by the getter (fixed 2026-07-12; previously always reported nil). |
Settings | *(Get only)* Output structure; as of 2026-07-12 has 7 fields (DuplexMode/NumCopies/PickTrayByPDFSize/PrintRanges/StructSize/PrintScaling/NumRanges) — the last two are additive, appended after StructSize. All fields now faithfully reflect whatever was last set. |
Return value. True if IPDF resolves, for all three functions.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Getters
pdfGetInPrintSettings
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.