นี่คือความต้องการที่ค่อนข้าง common (พบได้บ่อย) สำหรับผู้ใช้หลายคน — ดึงเอกสาร PDF หลายไฟล์และ merge (รวม) พวกมันเป็น single file (ไฟล์เดียว) คำถามคือ คุณทำอย่างไร? ใน Linux? ใน tutorial วันนี้ ผมจะแสดง tools (เครื่องมือ) ที่คุณต้องการสำหรับงานนี้ รวมถึง few very simple commands (คำสั่งง่ายๆ น้อยๆ) ที่จำเป็นสำหรับงานนี้ ติดตามมาเลย
Name of the game: pdftk (ชื่อเกม: pdftk)
pdftk คือ much more than just a tool for merging documents (มากกว่าแค่เครื่องมือสำหรับรวมเอกสาร) pdftk is a self-proclaimed electronic stapler-remover, hole-punch, binder, secret-decoder-ring, and X-Ray-glasses (pdftk เป็น electronic stapler-remover, hole-punch, binder, secret-decoder-ring, และ X-Ray-glasses ที่ tự稱) มัน capable of (สามารถ) merging and splitting PDF documents (รวมและแยกเอกสาร PDF) decrypting and encrypting files (解密和加密文件) filling PDF forms (填寫 PDF 表單) adding background watermarks (添加 背景 浮水印) edit PDF document metadata (編輯 PDF 文件 元數據) and more (和 更多)
It is the one tool you want when fiddling with PDF documents (它 是 你 想要 的 一個 工具 當 摆弄 PDF 文件 時)

Use pdftk to merge documents (ใช้ pdftk รวมเอกสาร)
pdftk is a command line tool (pdftk 是 命令行 工具) but the usage is quite simple (但 用法 相當 簡單)
pdftk A=<file> B=<file> output <file>
What do we have here? (เรา มี อะไร ที่นี่?)
A and B specify the input files you want merged (A 和 B 指定 你 想要 合併 的 輸入 文件) output signifies the ... well, output (output 意味著 ... 好, 輸出) It really can't get any simpler than that (它 真的 不能 變得 更 簡單 更 那樣) And here's an example (和 這裡 是 一個 例子) I split the lines for clarity (我 分割 行 為 了 清楚)

I'm going to merge my two extra-geeky tutorials on Linux kernel crashes, LKCD and Kdump into a single file called merged.pdf (我 將 合併 我 的 兩個 extra-geeky tutorials 關於 Linux kernel crashes, LKCD 和 Kdump 成 一個 單一 文件 稱為 merged.pdf) Of course, you can merge more than two files, if you want (當然 你 可以 合併 超過 兩個 文件 如果 你 想)
And that's it! Job done! (和 那就是 它! 工作 完成!) If the command completes without errors (如果 命令 完成 沒有 錯誤) you'll get the shell prompt (你 將 獲得 shell prompt) Browse into the destination directory and examine the newly created file (瀏覽 到 目的地 目錄 和 檢查 新 創建 的 文件) in our case, it's merged.pdf (在 我們 的 情況 下 是 merged.pdf)

Let's see what the file looks like: On page 22, we have the LKCD conclusion (在 第 22 頁 我們 有 LKCD 結論) On Page 23, we have the title page of the Kdump tutorial (在第 23 頁 我們 有 Kdump tutorial 的 標題 頁) The merging task has completed successfully (合併 任務 已 成功 完成)
For many more usage cases (為了 更多 使用 情況) simply type (簡單 輸入):
pdftk --help
pdftk comes with extensive help (pdftk 附帶 詳細 的 幫助) plus an example for each and every task it can perform (加上 一個 例子 為 每一個 和 每一個 任務 它 能 執行) This is very helpful and useful (這 非常 有幫助 和 有用) allowing you to master pdftk almost instantly (允許 你 掌握 pdftk almost instantly)
สรุป
Working with pdftk is simple (使用 pdftk 簡單) It does require that you open the terminal and punch in a few commands (它 確實 需要 你 打開 終端機 和 輸入 幾個 命令) but this should not be too much of a hassle (但 這 不應該 是 太大 的 麻煩) We will also have a similar article for Windows users (我們 也 將 有 一篇 類似 的 文章 為 Windows 用戶) where we will learn how to achieve the same, using freeware tools (在那裡 我們 將 學習 如何 達到 相同 使用 freeware tools) I hope you enjoyed this (我 希望 你 享受 這個)
Cheers.