pdfGetViewerPreferences
Get/set the document's /ViewerPreferences dictionary
BOOL32 __stdcall pdfGetViewerPreferences(PPDF IPDF, int32_t* Preference, int32_t* AddVal);
BOOL32 __stdcall pdfGetViewerPrefrences(PPDF IPDF, int32_t* Preference, int32_t* AddVal);
BOOL32 __stdcall pdfSetViewerPreferences(PPDF IPDF, int32_t Value, int32_t AddVal);
function pdfGetViewerPreferences(const IPDF: PPDF; Preference, AddVal: PInteger): LongBool; stdcall;
function pdfSetViewerPreferences(const IPDF: PPDF; Value, AddVal: Integer): LongBool; stdcall;
Purpose. Get/set the document's /ViewerPreferences dictionary bit-flags plus one auxiliary numeric value.
Description. pdfGetViewerPrefrences (missing the second "e" in "Preferences") is a genuine DLL export — confirmed in the module's export table as an explicit alias for the exact same implementation as pdfGetViewerPreferences, per a source comment: "typo'd 'pdfGetViewerPrefrences' aliased to the correctly-spelt export." This preserves an equivalent typo present in the classic API's official API surface, for drop-in compatibility with code already written against that misspelled name — it is not a bug in this SDK, but a deliberately preserved compatibility alias.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Preference/Value | The /ViewerPreferences bit-flags. |
AddVal | An auxiliary numeric value (e.g. for preferences like /NumCopies that pair a flag with a count). |
Return value. True on success; False if IPDF is invalid.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Getters
pdfGetViewerPrefrences
pdfGetViewerPreferences
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.