RenderDocumentToFile

渲染和列印

描述

把所選文件的指定頁面描繪成磁碟上的影像檔案

描繪預設使用 GDI+ 系統,Windows XP 之後的系統都內建。選項 10(TIFF (G4) 輸出)只在 Windows Vista、Windows Server 2008 及之後的系統上可用

也可以改用 Cairo 描繪,使用 SetCairoFileName 與 SelectRenderer 函式

語法

Delphi

Function TPDFlib.RenderDocumentToFile(DPI: Double; StartPage, EndPage, Options: Integer; Const FileName: WideString): Integer;

ActiveX

Function PDFlib::RenderDocumentToFile(DPI As Double, StartPage As Long, EndPage As Long, Options As Long, FileName As String) As Long

DLL

int DLRenderDocumentToFile(int InstanceID, double DPI, int StartPage, int EndPage, int Options, const wchar_t * FileName);

參數

DPI描繪使用的 DPI。值為 72 時,結果與 Acrobat 縮放 100% 相同。
StartPageThe first page to print
EndPageThe last page to print
Options0 = BMP 輸出 1 = JPEG 輸出 2 = WMF 輸出 3 = EMF 輸出 4 = EPS 輸出 5 = PNG 輸出 6 = GIF 輸出 7 = TIFF 輸出 8 = EMF+ 輸出 9 = HTML5 輸出 10 = G4 TIFF 輸出 檔案使用的路徑與檔名。每一頁會存成個別檔案。此參數含 "%p" 時會以頁碼取代;否則頁碼會加在副檔名前的檔名結尾。例如 FileName 為 "output.jpg" 而描繪第 10 頁時,影像會存成名為 "output10.jpg" 的檔案;FileName 為 "page%poutput.bmp" 而描繪第 5 頁時,影像會存成名為 "page5output.bmp" 的檔案。
FileName

傳回值

0頁面描繪失敗。通常是 StartPage 或 EndPage 參數超出範圍所致。
1頁面描繪成功