API referenceCore SDK

pdfGetDocumentIdentifier

Return a full /ID[Part] value as a string, in either

C
const char* __stdcall pdfGetDocumentIdentifierA(PPDF IPDF, int32_t Part, int32_t Options);
const wchar_t* __stdcall pdfGetDocumentIdentifierW(PPDF IPDF, int32_t Part, int32_t Options);
Delphi
function pdfGetDocumentIdentifierA(const IPDF: PPDF; Part, Options: Integer): PAnsiChar; stdcall;
function pdfGetDocumentIdentifierW(const IPDF: PPDF; Part, Options: Integer): PWideChar; stdcall;

Purpose. Return a full /ID[Part] value as a string, in either uppercase hex (Options = 0) or raw byte form (Options <> 0).

Parameters.

ParameterDescription
IPDFDocument handle.
PartWhich /ID array entry.
Options0 = uppercase hex string; non-zero = raw bytes (through a text pointer — embedded nulls will truncate the apparent C-string length for a caller treating it as null-terminated).

Return value. Pointer to a transient buffer; nil if IPDF is invalid.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern IntPtr pdfGetDocumentIdentifierW(IntPtr IPDF, int Part, int Options);
public static extern IntPtr pdfGetDocumentIdentifier(IntPtr IPDF, int Part, int Options);
public static extern IntPtr pdfGetDocumentIdentifierA(IntPtr IPDF, int Part, int Options);
Area
Core SDK
Category

Getters

Exported names

pdfGetDocumentIdentifierW pdfGetDocumentIdentifier pdfGetDocumentIdentifierA

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.