===== 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''. sudo apt install poppler-utils Then use ''pdfunite'': pdfunite [] **2nd. option:** Otherwise you can use ''pdftk'': sudo apt install pdftk With this command structure: pdftk cat output //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: pdftk cat 1east end output → To rotate anti-clockwise use this command: pdftk cat 1west end output 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: pdftk cat 1-r2 output