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
| TextBlockListID | Handle returned by DAExtractPageTextBlocks or ExtractPageTextBlocks |
|---|---|
| Index | 1-based text block index |
| CharIndex | 1-based UTF-16 code-unit position inside the block text |
| Left | Receives the minimum X coordinate in raw page units; zero on failure |
| Top | Receives the maximum Y coordinate in raw page units; zero on failure |
| Right | Receives the maximum X coordinate in raw page units; zero on failure |
| Bottom | Receives 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