API referenceImport & Output APIs

pdfCloseTag

Close the most-recently-opened, not-yet-closed structure

C
BOOL32 __stdcall pdfCloseTag(PPDF IPDF);
Delphi
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.

ParameterDescription
IPDFDocument 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)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Import & Output APIs
Category

Core

Exported names

pdfCloseTag

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.