RenderPageTiledToFile
Rendering, tiled rendering, file output
Description
File-output counterpart of RenderPageTiledToStream with identical grid, overlap, worker and background behaviour
Syntax
Function RenderPageTiledToFile(DPI: Double; Page, TileWidth, TileHeight, Overlap, Options, BackgroundMode: Integer; BackgroundColor: Cardinal; MaxWorkers: Integer; Const FileName: WideString): 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 |
| FileName | Destination file path; an empty value is rejected, and the completed image replaces the file only after rendering and writing succeed |
Return values
1 on success, otherwise 0 and no partial output file is retained
Remarks
The completed image replaces the destination only after rendering and writing succeed. A render or write failure leaves an existing file intact