DAGetTextBlockCharSourceFlags
Direct Access, Text, Extraction, Diagnostics
Description
Returns source-provenance flags for one character in a Direct Access text block
Syntax
Delphi
Function TPDFlib.DAGetTextBlockCharSourceFlags(TextBlockListID, Index, CharIndex: Integer): Integer;Parameters
| TextBlockListID | Handle returned by DAExtractPageTextBlocks |
|---|---|
| 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
The flags are stored in the text block list, and the file handle is not needed after extraction until the list is released
Use bitwise tests because a replacement character can also be a hyphen