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

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
FileNameDestination BMP path; an existing file is replaced

Return values

1The grayscale bitmap was written
0The page render or the file write failed

See also

RenderPageToMonochromeFile, RenderPageToMonochromeFileEx