RenderPageTileToStream

Rendering, tiled rendering, streams

Description

Renders an arbitrary device-pixel rectangle from one page and writes the encoded raster tile to Target

Overlap expands the requested rectangle on every available edge while clipping it to the page, which supports seam-free filtering and later cropping to the core rectangle

The tile is drawn by the renderer chosen with SelectRenderer. With PDFium, tiles are rendered one at a time from a single parsed copy of the document, and the render crop type and optional content state are not applied

Syntax

Function RenderPageTileToStream(DPI: Double; Page, PixelLeft, PixelTop, PixelWidth, PixelHeight, Overlap, Options, BackgroundMode: Integer; BackgroundColor: Cardinal; Target: TStream): Integer;

Parameters

DPIRender resolution in dots per inch, scaled by the library render scale
PageOne-based page number to render
PixelLeft, PixelTopZero-based tile origin in rendered device pixels
PixelWidth, PixelHeightPositive core tile dimensions before overlap
OverlapExtra pixels requested on each available edge
OptionsRaster format constant for BMP, JPEG, PNG, GIF, TIFF or G4 TIFF
BackgroundModePDF_TILE_BACKGROUND_WHITE, PDF_TILE_BACKGROUND_TRANSPARENT or PDF_TILE_BACKGROUND_CUSTOM
BackgroundColorCustom fill or PNG transparency-key colour
TargetDestination stream for the encoded tile; the tile is written at its current position

Return values

1 on success, otherwise 0 with details in LastRenderError