API referenceCore SDK

pdfGetBaseURL

Get/set the document's /URI base-URL catalog entry, used

C
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);
Delphi
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)

wrappers/dotnet/LumasPdf.cs
public static extern IntPtr pdfGetBaseURLW(IntPtr IPDF);
public static extern IntPtr pdfGetBaseURL(IntPtr IPDF);
public static extern IntPtr pdfGetBaseURLA(IntPtr IPDF);
Area
Core SDK
Category

Getters

Exported names

pdfGetBaseURLW pdfGetBaseURL pdfGetBaseURLA

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.