DAGetTextBlockCharBox

Direct access, Text, Geometry

Description

Returns an axis-aligned character-cell box in raw page coordinates

Syntax

Delphi

Function TPDFlib.DAGetTextBlockCharBox(TextBlockListID, Index, CharIndex: Integer; Out Left, Top, Right, Bottom: Double): Integer;

Parameters

TextBlockListIDHandle returned by DAExtractPageTextBlocks or ExtractPageTextBlocks
Index1-based text block index
CharIndex1-based UTF-16 code-unit position inside the block text
LeftReceives the minimum X coordinate in raw page units; zero on failure
TopReceives the maximum Y coordinate in raw page units; zero on failure
RightReceives the maximum X coordinate in raw page units; zero on failure
BottomReceives the minimum Y coordinate in raw page units; zero on failure

Outputs

Left and Right receive the minimum and maximum X coordinates while Top and Bottom receive the maximum and minimum raw Y coordinates

Return values

1 on success, or 0 with zero outputs for an invalid handle or index

Remarks

The method now uses retained rotation-aware and shear-aware character geometry in constant time instead of summing every preceding width

For compatibility it accepts handles from either DAExtractPageTextBlocks or ExtractPageTextBlocks and always returns raw page coordinates

See also

DAGetTextBlockCharLooseBox, GetTextBlockCharBox