TransformFile
文档操作、杂项函数
描述
对文件应用转换,允许重新编号和重新排序对象
在某些情况下,这会生成更紧凑的交叉引用表,从而减小 PDF 的大小
语法
Delphi
Function TPDFlib.TransformFile(Const InputFileName, Password, OutputFileName: WideString; TransformType, Options: Integer): Integer;
ActiveX
Function PDFlib::TransformFile(InputFileName As String, Password As String, OutputFileName As String, TransformType As Long, Options As Long) As Long
DLL
int DLTransformFile(int InstanceID, const wchar_t * InputFileName, const wchar_t * Password, const wchar_t * OutputFileName, int TransformType, int Options);
参数
| InputFileName | 要转换的输入 PDF 的路径和文件名 |
|---|---|
| Password | 输入 PDF 已加密时用于打开它的可选密码 |
| OutputFileName | 要创建的已签名 PDF 的路径和文件名,应不同于 InputFileName |
| TransformType | 1 = 重新编号所有对象并按顺序写出 2 = 与 1 相同,但使用 xref 流 |
| Options | 保留供将来使用,应设为零 |
返回值
| 1 | 成功 2 找不到输入 PDF 3 输入 PDF 无法读取 4 输入 PDF 密码不正确 5 无法写入输出文件 int TransformType, int Options); |
|---|