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

TextBlockListIDHandle returned by ExtractPageTextBlocks
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

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