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); |
|---|