TransformFileA
文件操作、其他函式
描述
結尾的 A 表示 ANSI(char)DLL 進入點;ActiveX/COM 介面只提供 Unicode 形式。行為與 TransformFile 完全相同,字串參數依目前 SetAnsiMode 的字碼頁解讀
對檔案套用轉換,讓物件可以重新編號與重排
某些情況下這會產生更緊湊的交叉參照表,縮小 PDF 體積
語法
Delphi
Function DLTransformFileA(InstanceID: Integer; InputFileName, Password, OutputFileName: PAnsiChar; TransformType, Options: Integer): Integer;
DLL
int DLTransformFileA(int InstanceID, const char* InputFileName, const char* Password, const char* 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 | 無法寫出輸出檔案 |