RenderDocumentToFileA
渲染和打印
描述
末尾的 A 表示 ANSI(char)DLL 入口点;ActiveX/COM 接口仅公开 Unicode 形式。其行为与 RenderDocumentToFile 相同,字符串参数使用当前 SetAnsiMode 代码页进行解释
有关此功能、参数或返回值的说明
默认情况下,渲染使用 Windows XP 及更高版本默认可用的 GDI+ 系统,选项 10(TIFF(G4)输出)仅在 Windows Vista、Windows Server 2008 及更高版本中可用
也可以使用 Cairo 进行渲染,请使用 SetCairoFileName 和 SelectRenderer 函数
语法
Delphi
Function DLRenderDocumentToFileA(InstanceID: Integer; DPI: Double; StartPage, EndPage, Options: Integer; FileName: PAnsiChar): Integer;
DLL
int DLRenderDocumentToFileA(int InstanceID, double DPI, int StartPage, int EndPage, int Options, const char * FileName);
参数
| DPI | 用于渲染的 DPI,值为 72 时,在缩放级别为 100% 的情况下会得到与 Acrobat 相同的结果 |
|---|---|
| StartPage | 要打印的第一页 |
| EndPage | 要打印的最后一页 |
| Options | 0 = 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 | 页面已成功渲染 |