int32_t __stdcall pdfSetAnsiMode(PPDF IPDF, int32_t NewAnsiMode);
function pdfSetAnsiMode(const IPDF: PPDF; NewAnsiMode: Integer): Integer; stdcall;
Purpose. Select whether A-suffixed text parameters in the "gap layer" decode as the system default codepage or as UTF-8.
Description. Real, but stored as a process-wide global (GGapAnsiUTF8), not a per-document field — despite accepting IPDF (used only to validate the handle, not to scope the setting), calling this on one document handle changes ANSI-text decoding behavior for every document handle's subsequent A-suffixed gap-layer calls within the same process, for the remainder of the process's lifetime (or until changed again). This is a real cross-document side effect worth being aware of in any application juggling multiple PPDF handles concurrently.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle (validity check only — the effect is process-global). |
NewAnsiMode | 0 = system codepage (default); non-zero = UTF-8. |
Return value. 1 if IPDF is valid; 0 otherwise.
C# (P/Invoke)
public static extern int pdfSetAnsiMode(IntPtr IPDF, int NewAnsiMode);
Setters
pdfSetAnsiMode
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.