GetPageThumbnailDataToStream

Page properties and extraction

Description

Writes the stored or filter-decoded /Thumb image payload for one page to a caller-provided stream

Syntax

Function TPDFlib.GetPageThumbnailDataToStream(Page, DataMode: Integer; OutStream: TStream): Integer;

Parameters

PageOne-based page number
DataModePDF_THUMBNAIL_DATA_RAW keeps the stream filters intact, while PDF_THUMBNAIL_DATA_DECODED removes supported PDF wrapping filters
OutStreamDestination stream written from its current position

Return values

0The page, mode, destination, thumbnail type or stream data is invalid
1The thumbnail payload was written

Remarks

Raw data is copied in bounded chunks and decoded data uses the library stream-filter pipeline

Decoding removes PDF wrappers but preserves terminal image encodings such as DCTDecode and JPXDecode, so the result is native image payload data rather than a raster bitmap or PNG file

The selected page is restored before the method returns

See also

GetPageThumbnailDataToString, GetPageThumbnailInfo, DeletePageThumbnail