| Category | Tagged PDF / structure tree |
|---|---|
| Note | functionally 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
BOOL32 __stdcall pdfSetTagID(PPDF IPDF, const char* ID);
function pdfSetTagID(const IPDF: PPDF; const ID: PAnsiChar): LongBool; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
ID | PAnsiChar | New /ID value, ANSI only. |
Return value — TRUE 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 also — pdfSetStructElemID
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Setters
pdfSetTagID
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.