API reference › Import & Output APIs
pdfCloseTag
Close the most-recently-opened, not-yet-closed structure
BOOL32 __stdcall pdfCloseTag(PPDF IPDF);
function pdfCloseTag(const IPDF: PPDF): LongBool; stdcall;
Purpose. Close the most-recently-opened, not-yet-closed structure element — the symmetric counterpart to pdfOpenTag/pdfOpenTagEx/ pdfOpenTagBBox, all three of which push onto the same open-tag stack this function pops.
Description. Genuinely real and simple: emits the literal EMC (End Marked Content) content-stream operator and decrements the open-tag stack depth (FOpenTagN). Takes no tag handle or identifier at all — it always closes whichever tag is currently on top of the stack, matching the standard nested BDC/EMC marked-content pairing convention (structure tags must close in strict LIFO order, same as PDF's own graphics-state q/Q and BDC/EMC nesting rules) — there is no way to close a specific, non-topmost open tag out of order through this function.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Return value. True if a tag was actually open to close (False if the open-tag stack is already empty, or no content stream is available).
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Core
pdfCloseTag
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.