ExtractPageTextBlocks
Text, Extraction
Description
Similar to the GetPageText function but the results are stored in a text block list rather than returned as a CSV string
Once the results are in the text block list, functions such as GetTextBlockCount, GetTextBlockText and GetTextBlockColor can be used to retrieve the properties of each block of text
Unicode extraction resolves verified ToUnicode inheritance from embedded base streams and the bundled Adobe ToUnicode resources, including child overrides, ligatures, and supplementary Unicode targets. Unsupported bases do not authorize guessed mappings; see Unicode CMap Resources
Syntax
Delphi
Function TPDFlib.ExtractPageTextBlocks(ExtractOptions: Integer): Integer;
ActiveX
Function PDFlib::ExtractPageTextBlocks(ExtractOptions As Long) As Long
DLL
int DLExtractPageTextBlocks(int InstanceID, int ExtractOptions);
Parameters
| ExtractOptions | 3 = Normal extraction 4 = Split words |
|---|
Return values
| 0 | The text could not be extracted |
|---|---|
| Non-zero | A TextBlockListID value |
Encoding CMap decoding
Native extraction preserves one-to-four-byte character codes and their CID mappings, using complete source bytes for ToUnicode lookup and the declared WMode for text movement; see Encoding CMap decoding
Vertical composite text
Composite extraction with verified vertical WMode follows the column baseline and its DW2 and W2 advances, preserving source locations and reading order across text-showing operators. Horizontal scaling changes glyph width without scaling vertical cursor movement
Type3 text
Type3 extraction follows the horizontal component of FontMatrix-transformed widths, with character spacing, word spacing, text rise, and horizontal scaling applied in text space. Complete known Differences mappings preserve ligatures and supplementary characters without a ToUnicode stream, while Unicode status still records that ToUnicode is absent
Content strings retain their font-encoded bytes, including a leading FE FF sequence; see Type3 exact editing