合併 PDF
動詞:pdfMerge
可用來源: <Standard>
將兩個以上的 PDF 檔案合併為具有相同格式的單一檔案。
語法
pdfMerge [--files(List<String>)] [--directory(String)] [--filemask(String)] --outputpath(String) (Pdf)=value (String)=file
輸入
Script | 設計工具 | 必要 | 接受的類型 | 說明 |
---|---|---|---|---|
-- 檔案 | 檔案 | 選用項目 | List<Text>, List<PDF> | 包含 PDF 檔案完整路徑或包含了含檔案之變數的清單。 |
--directory | 來源目錄 | 選用項目 | Text | 要從中搜尋檔案的目錄。 |
--filemask | 檔案遮罩 | 選用項目 | Text | 用於依名稱過濾 PDF 檔案的遮罩。僅按 PDF 檔案的名稱,而不按其副檔名進行過濾。 此外,遮罩僅適用於在來源目錄中過濾檔案。 |
--outputpath | 輸出路徑 | 必要 | Text | 合併 PDF 檔案後將被改寫的 PDF 檔案的完整路徑。建立的 PDF 檔案的名稱必須不同於現有檔案。 |
輸出
Script | 設計工具 | 接受的類型 | 說明 |
---|---|---|---|
價值 | 傳回已執行合併的 PDF 檔案。 | ||
檔案 | 檔案路徑 | Text | 傳回儲存合併後的 PDF 檔案的位置的完整路徑。 |
範例
範例 1:使用合併 PDF 指令合併 01 和 02 檔案,這些檔案都是 PDF 格式且都包含在目錄中,這樣在執行之後就會以 PDF 03 檔案的形式傳回上標合併。
defVar --name mergedFilesPath --type String
defVar --name pdf --type Pdf
pdfMerge --directory "Full path of the files to be merged" --outputpath "Full path where the third pdf generated will be found " pdf=value mergedFilesPath=file
logMessage --message "${pdf}${mergedFilesPath}" --type "Info"
//Returns the path of the merged pdfs
若要測試上述 Script,您需要下載 pdf1.pdf 和 pdf2.pdf,將它們儲存在相同的目錄中,並在來源目錄 參數中輸入此目錄。 之後,請在輸出路徑 參數中輸入路徑,新的合併 pdf 將在這裡產生。
另請參閱
<>比較 PDF</