GetTextBlockCharSourceFlags
Text, Extraction, Diagnostics
Description
Returns source-provenance flags for one character in a selected-document text block
Syntax
Delphi
Function TPDFlib.GetTextBlockCharSourceFlags(TextBlockListID, Index, CharIndex: Integer): Integer;Parameters
| TextBlockListID | Handle returned by ExtractPageTextBlocks |
|---|---|
| Index | 1-based text block index |
| CharIndex | 1-based character position inside the block text |
Return values
| -1 | The handle, block index or character index is invalid |
|---|---|
| 0 or flags | The character is ordinary content or the result contains one or more source flags |
Flags
PDF_TEXT_CHAR_SOURCE_GENERATED | The extraction layout inferred the character, such as a space inserted for a large advance gap |
|---|---|
PDF_TEXT_CHAR_SOURCE_HYPHEN | The character is a hyphen-minus, soft hyphen, hyphen or non-breaking hyphen |
PDF_TEXT_CHAR_SOURCE_REPLACEMENT | The character came from an honoured /ActualText replacement rather than the enclosed glyph run |
Remarks
Flags are captured during the same extraction pass as text and character widths, so repeated queries do not parse page content again
Use bitwise tests because a replacement character can also be a hyphen