SetStructElemStartIndent

Tagged PDF, Accessibility

Description

Sets the /StartIndent attribute (Layout attribute owner) on the structure element currently open on the tag stack. The value specifies the distance between the start edge of the content rectangle and the start edge of the element's content — analogous to CSS padding-left (for LrTb writing mode) or padding-right (for RlTb writing mode). Equivalent to calling AddTagAttribute with Owner=Layout, Name=StartIndent, and the numeric value as a string.

Syntax

Delphi

function TPDFlib.SetStructElemStartIndent(Indent: Double): Integer;

ActiveX

Function PDFlib::SetStructElemStartIndent(Indent As Double) As Long

DLL

int DLSetStructElemStartIndent(int InstanceID, double Indent);

Parameters

IndentIndentation from the start edge of the content rectangle in default user space units (points, 1/72 inch). Positive values move the block away from the start edge; negative values are permitted by some re-flow engines for hanging indents.

Return value

Returns 1 on success. Returns 0 if no document is open or no tag is currently open on the tag stack.

Remarks

Call this function after BeginTag or BeginTagEx and before EndTag. The /StartIndent attribute is defined in ISO 32000-1 §14.8.5.4.2 (Layout attribute owner, Table 340).

The "start edge" depends on the writing mode. For LrTb (left-to-right) it is the left edge; for RlTb (right-to-left, e.g. Arabic/Hebrew) it is the right edge. This makes the attribute writing-mode-aware, unlike a fixed left/right margin. Pair with SetStructElemEndIndent to set both sides.

Example

// Tag an indented block quote
PDFlib.BeginTag('BlockQuote', '', '', '');
PDFlib.SetStructElemStartIndent(36.0);  // 0.5 inch from start edge
PDFlib.SetStructElemEndIndent(36.0);
PDFlib.DrawText('A quoted passage...', 108, 660);
PDFlib.EndTag;

See also

SetStructElemEndIndent, SetStructElemSpaceBefore, SetStructElemWritingMode, AddTagAttribute