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

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
FileNameDestination 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