SavePageRangeTextToStream

Text and extraction

Description

Writes UTF-8 text from the requested pages directly to a stream without buffering the complete document text

Syntax

Function TPDFlib.SavePageRangeTextToStream(Const PageRange: WideString; ExtractOptions: Integer; Const PageSeparator: WideString; Target: TStream): Integer;

Parameters

PageRangeOne-based page-range expression such as 1-3,7; an empty value selects every page
ExtractOptionsText extraction option from 0 to 11, as documented for GetPageText; values outside that range reject the call
PageSeparatorText inserted between consecutive pages and encoded as UTF-8; empty writes pages back to back
TargetDestination stream; writing starts at its current position and no UTF-8 byte-order mark is emitted

Return values

Returns the number of pages written, or zero when the arguments or page range are invalid

Remarks

Output starts at the current stream position and does not include a UTF-8 byte-order mark

See also

ExtractPageRangeText, SavePageRangeTextToFile