Editing PDF Structure with QPDF

Command Line – QPDF

© Lead Image © Joe Belanger, 123RF.com

© Lead Image © Joe Belanger, 123RF.com

Article from Issue 226/2019
Author(s):

Use QPDF to easily make structural changes to your PDFs, including reorganizing pages, creating watermarks, setting encryption options, and changing permissions.

QPDF [1] is a structural editor for PDF files. This description places it in a very specific niche. In its usual output method, it does not edit the content of PDF files – to the extent that editing content is possible, opening a PDF in LibreOffice is generally the easiest way to work. Nor does QPDF import PDFs to different formats – the repositories of major distributions like Debian are full of scripts for that, like pdf2htmlEX and pdf2svg. However, if you need to change how a PDF is put together, QPDF is a toolkit that is both comprehensive and more convenient than the assorted scripts that only perform a single function. In fact, by adding options, you can make an entire series of structural edits with a single command. QPDF is especially handy if you no longer have the file from which a PDF was generated and are therefore unable to make a new one with different settings.

QPDF is available in many distributions. If it is not in your distribution's repository, you can download the source code from the project site and build it with the usual trio of commands: configure, make, and make install. The syntax, too, is simple:

qpdf OPTIONS ORIGINAL-FILE OUTPUT-FILE

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Peace of Mind

    PDFs, the preferred format for file sharing, only offer primitive privacy and security measures. With these command-line tools, you can help your PDFs meet modern security requirements.

  • Minuimus

    The Minuimus Perl script helps you save disk space by reducing the file size of PDF files with just a few commands.

  • Extract Pages from a PDF File with a GUI Bash Script
  • MuPDF

    PDFs with many hundreds of pages and equal numbers of images can easily bring PDF viewers such as Okular or Evince to their knees. In contrast, MuPDF puts even the thickest digital tomes on your screen in the blink of an eye.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News