RenderPageToGrayscaleFile
Rendering and printing
Description
Renders a page and reduces it to 8-bit grayscale using the Rec. 601 luma weights (0.299 R + 0.587 G + 0.114 B)
On Windows the output is a palette BMP whose 256 entries form the identity gray ramp, so index N decodes to level N; other platforms write the same pixels as a 24-bit BMP with R=G=B
Syntax
Delphi
Function TPDFlib.RenderPageToGrayscaleFile(DPI: Double; Page: 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 |
| FileName | Destination BMP path; an existing file is replaced |
Return values
| 1 | The grayscale bitmap was written |
|---|---|
| 0 | The page render or the file write failed |