RenderPageToFile

Rendering and printing

Description

This function renders a page from the selected document to a file on disk. The data written to disk depends on the Options parameter.

By default rendering uses the GDI+ system which is available by default in Windows XP and later.

Option 10, TIFF (G4) output, is only available on Windows Vista and Windows Server 2008 and later.

It is also possible to render using Cairo, use the SetCairoFileName and SelectRenderer

functions.

Syntax

Delphi

function TPDFlib.RenderPageToFile(DPI: Double; Page, Options: Integer; Const FileName: WideString): Integer;

ActiveX

Function PDFlib::RenderPageToFile(DPI As Double, Page As Long, Options As Long, FileName As String) As Long

DLL

int DLRenderPageToFile(int InstanceID, double DPI, int Page, int Options, wchar_t * FileName);

Parameters

DPIThe DPI to use when rendering the page. Values over 300 will cause excessive memory usage.
PageThe page number to render 0 = BMP output 1 = JPEG output 2 = WMF output 3 = EMF output 4 = EPS output 5 = PNG output 6 = GIF output 7 = TIFF (LZW) output 8 = EMF+ output 9 = HTML5 output 10 = TIFF (G4) output
Options
FileNameThe path and file name of the file to create to store the rendered page image data in.

Return values

0The page could not be rendered
1The page was rendered correctly and the image file was saved to disk The file could not be written to disk 2