API referenceCore SDK

pdfSetTagID

Set the /ID attribute on the currently-open structure

CategoryTagged PDF / structure tree
Notefunctionally duplicates pdfSetStructElemID (see Remarks)

Purpose — Set the /ID attribute on the currently-open structure element.

Description — Applies to the top of the open-tag stack (the most-recently-opened, not-yet-closed structure element via pdfOpenTag/ pdfCreateStructureTreeEx), or — if no tag is currently open — to the most-recently-*registered* element overall. There is no handle parameter; you cannot target an arbitrary earlier element by ID this way. Serialized as both /ID (id) on the StructElem dictionary and an entry in the StructTreeRoot's /IDTree.

Declarations

C
BOOL32 __stdcall pdfSetTagID(PPDF IPDF, const char* ID);
Delphi
function pdfSetTagID(const IPDF: PPDF; const ID: PAnsiChar): LongBool; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
IDPAnsiCharNew /ID value, ANSI only.

Return valueTRUE if at least one structure element exists (open or registered) and the target index is valid; FALSE if no elements exist yet.

Remarks — duplicate functionality. This ABI-compatible entry point and pdfSetStructElemID call the exact same internal SetLastTagID and operate on the exact same current-tag target — they differ only in that pdfSetTagID is ANSI-only and returns LongBool, while pdfSetStructElemID offers A/W variants and returns Integer (0/1). Either works identically; there is no functional reason to prefer one over the other beyond string-encoding needs.

See alsopdfSetStructElemID

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Core SDK
Category

Setters

Exported names

pdfSetTagID

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.