DARenderPageToFile
直接存取功能、描繪與列印
描述
把指定文件的指定頁面描繪成影像,並將影像資料存成磁碟上的檔案
描繪預設使用 GDI+ 系統,Windows XP 之後的系統都有提供
呼叫函式前請查看語法、參數和傳回值。程式碼區塊保留原始形式,便於範例直接複製使用。
呼叫函式前請查看語法、參數和傳回值。程式碼區塊保留原始形式,便於範例直接複製使用。
functions.
語法
Delphi
Function TPDFlib.DARenderPageToFile(FileHandle, PageRef, Options: Integer; DPI: Double; Const FileName: WideString): Integer;
ActiveX
Function PDFlib::DARenderPageToFile(FileHandle As Long, PageRef As Long, Options As Long, DPI As Double, FileName As String) As Long
DLL
int DLDARenderPageToFile(int InstanceID, int FileHandle, int PageRef, int Options, double DPI, const wchar_t * FileName);
參數
| FileHandle | 由 DAOpenFile、DAOpenFileReadOnly 或 DAOpenFromStream 函式傳回的控制代碼 |
|---|---|
| PageRef | 由 DAFindPage 或 DANewPage 函式傳回的頁面參照 |
| 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 9 = HTML5 output 10 = G4 TIFF output |
| DPI | 描繪頁面時使用的 DPI。超過 300 會造成過多的記憶體用量 |
| FileName | 要建立以存放描繪頁面影像資料的檔案路徑與檔名。 |
傳回值
| 0 | 無法描繪頁面。請檢查 FileHandle 與 PageRef 參數的值。 |
|---|---|
| 1 | 頁面描繪正確,影像檔案已存到磁碟 無法把檔案寫入磁碟 2 |