const char* __stdcall pdfGetBaseURLA(PPDF IPDF);
const wchar_t* __stdcall pdfGetBaseURLW(PPDF IPDF);
int32_t __stdcall pdfSetBaseURLA(PPDF IPDF, const char* NewBaseURL);
int32_t __stdcall pdfSetBaseURLW(PPDF IPDF, const wchar_t* NewBaseURL);
function pdfGetBaseURLA(const IPDF: PPDF): PAnsiChar; stdcall;
function pdfGetBaseURLW(const IPDF: PPDF): PWideChar; stdcall;
function pdfSetBaseURLA(const IPDF: PPDF; NewBaseURL: PAnsiChar): Integer; stdcall;
function pdfSetBaseURLW(const IPDF: PPDF; NewBaseURL: PWideChar): Integer; stdcall;
Purpose. Get/set the document's /URI base-URL catalog entry, used to resolve relative URI Link/GoToR-URI actions.
Description. Storage is Wide-string-based internally (BaseURLW) regardless of which entry point set it — A transcodes through the system default codepage on both get and set. The getters return nil specifically when the stored value is empty (not merely unset vs. explicitly-set-to-empty — the two states are indistinguishable).
Return value. Getters: pointer to the URL, or nil if empty/IPDF invalid. Setters: 1 on success; 0 if IPDF invalid.
C# (P/Invoke)
public static extern int pdfSetBaseURLW(IntPtr IPDF, IntPtr NewBaseURL);
public static extern int pdfSetBaseURL(IntPtr IPDF, IntPtr NewBaseURL);
public static extern int pdfSetBaseURLA(IntPtr IPDF, IntPtr NewBaseURL);
Setters
pdfSetBaseURLW
pdfSetBaseURL
pdfSetBaseURLA
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.