RenderPageTiledToStream

Rendering, tiled rendering, streams

Description

Renders a page as overlapping tiles, crops every tile back to its exact core boundary, stitches the cores without seams and writes one raster image to Target

Syntax

Function RenderPageTiledToStream(DPI: Double; Page, TileWidth, TileHeight, Overlap, Options, BackgroundMode: Integer; BackgroundColor: Cardinal; MaxWorkers: Integer; Target: TStream): Integer;

Parameters

DPIRender resolution in dots per inch, multiplied by the library render scale; it must be finite and positive
PageOne-based page number from 1 through the page count
TileWidthPositive core tile width in device pixels at the requested DPI
TileHeightPositive core tile height in device pixels at the requested DPI
OverlapExtra pixels rendered on each available edge; it must be non-negative, smaller than both tile dimensions, and the resulting grid must not exceed 1,000,000 tiles
OptionsOutput raster format: PDF_RENDER_BMP (0), PDF_RENDER_JPEG (1), PDF_RENDER_PNG (5), PDF_RENDER_GIF (6), PDF_RENDER_TIFF_RGB (7), or PDF_RENDER_TIFF_G4 (10)
BackgroundModePDF_TILE_BACKGROUND_WHITE (0), PDF_TILE_BACKGROUND_TRANSPARENT (1), or PDF_TILE_BACKGROUND_CUSTOM (2)
BackgroundColorCustom fill colour or PNG transparency-key colour in $00BBGGRR order, as used by TColor
MaxWorkersMaximum concurrent tile workers; 0 selects the processor count, while older compilers and FPC always use the serial path
TargetDestination stream, reset to position 0 and truncated before the stitched image is written

Return values

1 on success, otherwise 0

Remarks

Tile dimensions and overlap use device pixels at the requested DPI. The grid covers the effective crop box after rotation. With PDFium selected, the grid uses the page crop box and PDFium renders the tiles serially