Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tutorials:linux-cli-mergepdf [2023/09/12 08:45] – created Zyzonixtutorials:linux-cli-mergepdf [2024/10/01 18:32] (current) – [Rotate PDF] Zyzonix
Line 1: Line 1:
-===== Merge PDF on Linux CLI =====+===== PDF editing on Linux CLI ===== 
 + 
 +==== Merge PDF ==== 
 + 
 +You can easily merge two or more PDF's to one on Linux CLI - private and secure, without having the risk that any suspicious webservices crawls your data. 
 + 
 +**1st. option:** 
 +Therefore install the package ''poppler-utils''
 +<code bash>sudo apt install poppler-utils</code> 
 + 
 +Then use ''pdfunite'': 
 +<code bash>pdfunite <inputfile-1> <inputfile-2> [<inputfile-x>] <final-file></code> 
 + 
 +**2nd. option:** 
 +Otherwise you can use ''pdftk'': 
 +<code bash>sudo apt install pdftk</code> 
 + 
 +With this command structure: 
 +<code bash>pdftk <inputfile-1> <inputfile-2> cat output <final-file></code> 
 + 
 +//Paritally sourced from [[https://linuxopsys.com/topics/merge-pdf-files-on-ubuntu|linuxopsys.com - Merge PDF]]// 
 + 
 +==== Rotate PDF ==== 
 + 
 +It is also easy to rotate a PDF from CLI. Therefore install ''pdftk'' from the upper section. 
 + 
 +→ Then use this command to rotate clockwise: 
 +<code bash>pdftk <inputfile-1> cat 1east end output <final-file></code> 
 + 
 +→ To rotate anti-clockwise use this command: 
 +<code bash>pdftk <inputfile-1> cat 1west end output <final-file></code> 
 + 
 +By replacing e.g. ''1east'' with other cardinal directions, it is also possible to change a page by 180°. 
 + 
 +==== Delete page from PDF ==== 
 + 
 +It is also easy to delete the last page from a PDF via CLI. Therefore also install ''pdftk'' from the upper section. 
 + 
 +→ Then use this command to delete the **last** page: 
 +<code bash>pdftk <inputfile-1> cat 1-r2 output <final-file></code> 
 + 
  • tutorials/linux-cli-mergepdf.1694501119.txt.gz
  • Last modified: 2023/09/12 08:45
  • by Zyzonix