There are many options in the Fedora repositories for quickly modifying the page order of a PDF document. In Fedora, two of the easiest-to-use GUI tools for modifying PDFs are PDFMod and PDFShuffler. While GUI tools are well suited to this task, if you need a command line tool, the
and
package can modify PDFs directly from your Terminal. All These tools allow you to remove, add, and rearrange pages and export it to a new document.
These tools are also useful when creating PDFs with Inkscape. Inkscape currently only supports single-page export of PDFs, so you can use these tools in your workflow to join PDFs together after using Inkscape. Inkscape also supports importing a single pages of PDFs, so if you need to edit the actual content of a PDF Document, give Inkscape a try.
PDFmod & PDFShuffler
Both PDFmod and PDFShuffler are available in the Fedora repositories. Install them from the Software app in Fedora Workstation, or via the command line with DNF:
sudo dnf install pdfmod pdfshuffler
PDFMod and PDFShuffler are very similar applications — they look and function pretty much the same way. Once you have imported one or more PDFs into them, they provide a display of all the pages in the document, ready for you to start your modifications.
Rearrange the order of the pages by selecting (using Shift + Click and Ctrl + Click to select multiples), and drag ‘n’ drop them to their desired location in the Document. The same goes for removing pages; Select, then press delete. When you are done, simply save your document as a new PDF file.
pdfseparate and pdfunite
The popper-utils package provides several different commands for interacting with and modifying PDF files. However, the two commands that help us the most here are pdfseparate and pdfunite. Use dnf on the command line to install poppler-utils:
sudo dnf install poppler-utils
pdfseparate extracts pages into multiple PDFs that we can later merge together with pdfunite. To extract all the pages of a document into individual files, use:
pdfseparate ColoringBook.pdf ColoringBook-page_%d.pdf
To export a range of pages — say just pages 3,4,5,6,7,8 and 9 of a PDF — use the command:
pdfseparate -f 3 -l 9 ColoringBook.pdf ColoringBook-page_%d.pdf
Finally, after using pdfseparate, if we wanted to create a new document (NewColoringBook.pdf) with ColoringBook-page_3.pdf and ColoringBook-page_3.pdf we could use the following pdfunite command:
pdfunite ColoringBook-page_3.pdf ColoringBook-page_7.pdf NewColoringBook.pdf
Mohammed Ali Tayeh
Thanks for this post
i want to add xournal is very good Application for sketching and edit PDF File
http://xournal.sourceforge.net/
$ sudo dnf install xournal
Matěj Cepl
For normals among us, it is also of note that LibreOffice Draw is pretty good in dealing with multi-page PDFs (of course, for the one page ones, you could use Inkscape).
Sébastien Wilmet
Interesting article, I keep it in my bookmarks!
Goekhan
I would add http://jpdftweak.sourceforge.net/ – jpdftweak. It’s a Java app and crossplatform.
Anonymous Coward
QPDF can do this too: http://qpdf.sourceforge.net/files/qpdf-manual.html#ref.page-selection.
Yogesh Sharma
Only thing missing is PDF encrypt/decrypt tool. Any plans to have this feature in fedora ?
Yogesh Sharma
Still missing a critical feature (in my opinion) encryption .
Since pdftk was removed from distribution, I miss this feature.
Arthur
That was helpful. Does Fedora intends to keep posting utility articles like this one?
Paul W. Frields
@Arthur: Of course! We at the Magazine love to pass on helpful tips on tools for users.
SJS@Metcomm
Thanks for this interesting article, I use PDFShuffler regularly, very useful (and fast).
One application also that does more that’s ‘written on the tin’ is gscan2pdf. Although this application is mostly used for scanning and OCR operations, it is also useful for re-arranging individual pages. In fact one nice feature is to import an existing pdf into the application and then scan new materials directly adding to the file. Then you can rearrange the pages as desired before saving – and OCRing at the same time if required.
Katherine
ImageMagick has similar functionality to what you describe. Had to resort to this “back in the day” before these other tools became available. Great to see the Linux environment catching up with fuller functionality.
Alexander
There is also powerful pdfjam command line tool.
Paul W. Frields
@Alexander: There is indeed — it’s in the
package.
Alan Olsen
Is there a command line app that will test if a PDF is not corrupted?
Period22
qpdf does both encryption and decryption of pdf’s, and can also test whether pdf’s are structurally OK:
http://qpdf.sourceforge.net/
For those who need to check, delete or edit pdf metadata, here are a couple of very useful Nautilus scripts:
https://github.com/Glutanimate/
And finally, here’s a Nautilus script that lets you compress pdf’s in four compression levels:
https://launchpad.net/compress-pdf
psg_nm
It is worth noting that qpdf is actually available as a package for Fedora using “dnf install qpdf” (and probably “yum install qpdf” for earlier versions of Fedora). I don’t know how long it has been available, but I have been using it since Fedora 23.
Night Romantic
I’d also like to add to list pdf-stapler package/command for command line pdf manipulations. It allows you to rotate pages (all, ranges or specific ones), rearrange, cut to new file, concatenate from several files and such. Good to use in scripts too. It’s a python replacement to deprecated pdftk utility. Project’s GitHub page is
https://github.com/hellerbarde/stapler/
Also in my personal workflow i use one more command-line tool from poppler-utils package: pdfimages. It allows me to extract original images from pdfs (scanned usually, but graphs and photos from text pdfs as well) without changing them — like rescaling or such. And hopefully without a loss in quality such changes would do.
Terry Zongy
Use flpsed to fill out pdf forms easily.
Ralf Oltmanns
Spotted a typo in the last paragraph. It should say “ColoringBook-page_3.pdf and ColoringBook-page_7.pdf”.
Kind regards
Rossi