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
| DPI | Render resolution in dots per inch, multiplied by the library render scale; it must be finite and positive |
|---|---|
| Page | One-based page number from 1 through the page count |
| TileWidth | Positive core tile width in device pixels at the requested DPI |
| TileHeight | Positive core tile height in device pixels at the requested DPI |
| Overlap | Extra 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 |
| Options | Output 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) |
| BackgroundMode | PDF_TILE_BACKGROUND_WHITE (0), PDF_TILE_BACKGROUND_TRANSPARENT (1), or PDF_TILE_BACKGROUND_CUSTOM (2) |
| BackgroundColor | Custom fill colour or PNG transparency-key colour in $00BBGGRR order, as used by TColor |
| MaxWorkers | Maximum concurrent tile workers; 0 selects the processor count, while older compilers and FPC always use the serial path |
| Target | Destination 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