RenderDocumentToFile
Description
Renders certain pages from the selected document to an image file on disk. For best results this function requires GDI+, which is available by default in Windows XP. For other operating systems you may need the GDI+ redistributable available from Microsoft, which is called "gdiplus.dll". You can use the SetGDIPlusFileName function to specify where this DLL is installed. Encrypted documents cannot be rendered, they must be decrypted using Decrypt or DecryptFile.
Syntax
Delphi
function TQuickPDF0813.RenderDocumentToFile(DPI, StartPage, EndPage,
Options: Integer; FileName: WideString): Integer;
ActiveX
Function QuickPDF0813.PDFLibrary::RenderDocumentToFile(DPI As Long,
StartPage As Long, EndPage As Long, Options As Long,
FileName As String) As Long
DLL
int QuickPDFRenderDocumentToFile(int InstanceID, int DPI, int StartPage,
int EndPage, int Options, wchar_t * FileName)
Parameters
| DPI | The DPI to use for the rendering. A value of 72 will give the same result as Acrobat when the zoom level is 100%. |
| StartPage | The first page to print |
| EndPage | The last page to print |
| Options |
0 = BMP output 1 = JPEG output 2 = WMF output 3 = EMF output 4 = EPS output 5 = PNG output 6 = GIF output 7 = TIFF output 8 = EMF+ output |
| FileName |
The path and filename to use for the file. Each page will be stored in a separate file. If this parameter contains "%p" this will be replaced by the page number, otherwise the page number will be appended to the end of the filename before the extension. For example, if FileName is "output.jpg" and page 10 is rendered the image will be stored in a file called "output10.jpg". If FileName is "page%poutput.bmp" and page 5 is rendered the image will be stored in a file called "page5output.bmp". |
Return values
| 0 | The pages were not rendered successfully. This is usually caused by the StartPage or EndPage parameters being out of range. |
| 1 | The pages were rendered successfully |