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

TextBlockListIDHandle returned by DAExtractPageTextBlocks
Index1-based text block index
CharIndex1-based character position inside the block text

Return values

-1The handle, block index or character index is invalid
0 or flagsThe character is ordinary content or the result contains one or more source flags

Flags

PDF_TEXT_CHAR_SOURCE_GENERATEDThe extraction layout inferred the character, such as a space inserted for a large advance gap
PDF_TEXT_CHAR_SOURCE_HYPHENThe character is a hyphen-minus, soft hyphen, hyphen or non-breaking hyphen
PDF_TEXT_CHAR_SOURCE_REPLACEMENTThe 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