How To Edit PDF Metadata Tags On Linux Using A GUI Or Command Line

This article explains how to edit PDF metadata tags on Linux, using either a GUI or from the command line.

Edit PDF metadata tags on Linux using a GUI


To edit PDF metadata tags on Linux using a GUI we'll use Master PDF Editor or PDFMtEd. Why 2 tools? Because none of these two is even close to perfect in my opinion, so users should decide which best suits their needs. PDFMtEd is a bit weird to run and it uses the old Python 2, but it's lightweight and made using open source tools, while Master PDF Editor is a complete suite for editing PDF files, so it's pretty heavy on system resources, and it's not free and open source software either.

Using Master PDF Editor to edit PDF meta tags on Linux


Master PDF Editor is a proprietary application to edit PDF documents on Linux, Windows and macOS. It can create, edit (insert text or images), annotate, view, encrypt, and sign PDF documents. It also allows editing (and viewing) the following PDF metadata tags: Title, Subject, Author, Creator, Producer and Keywords.

Download Master PDF Editor by visiting its downloads page (it's available for CentOS, RedHat, and Ubuntu - I did not try to see if it runs on Debian).

It's worth nothing that with version 5, Master PDF editor has removed some features from its free to use version, like editing or adding text, inserting images and more, and for such features you need to buy the app or else it will add a watermark to your PDF documents. That's not the case for editing the PDF metadata though. Even so, there's also the alternative of using the last version of Master PDF Editor 4, which is free for non-commercial use with no restrictions.

Edit PDF metadata tags on Linux using Master PDF Editor

To edit / add / remove metadata from PDF files using Master PDF Editor, open a PDF using it, then from the application File menu click on Properties, and you'll see editable PDF metadata tag fields on the Document Info tab.

PDF-related: How To Convert PDF To Image (PNG, JPEG) Using GIMP Or pdftoppm Command Line Tool

Using PDF Arranger to edit PDF metadata on Linux


PDF Arranger has gained support for editing PDF metadata on both Linux and Windows. With version 1.4.0, it allows editing the PDF title, creator, producer and creator tool, while with version 1.7.0 it can also edit the PDF subject, keywords, modified and created date tags.

To edit the PDF meta tags using PDF Arranger, open a PDF using this application, then from its hamburger menu choose Edit Properties. Once you see the PDF meta tags window, double-click on a tag to edit it:

PDF Arranger edit metadata

Install PDF Arranger:

  • Debian / Ubuntu / Linux Mint / Pop!_OS, etc.:
sudo apt install pdfarranger

  • Fedora:
sudo dnf install pdfarranger

  • Arch Linux / Manjaro:
sudo pacman -S pdfarranger

  • Solus OS:
sudo eopkg install pdfarranger

PDF Arranger can also be installed from Flathub, and various third-party repositories. You can find a list of binary packages on its wiki.

Using PDFMtEd to edit PDF meta tags on Linux


PDFMtEd (PDF Metadata Editor) is a set of tools to simplify working with PDF metadata on Linux, consisting of a PDF metadata editor, a PDF inspector (used to view complete PDF metadata and optionally purge all PDF metadata), and a PDF thumbnailer. PDF Metadata Editor can process multiple files and folders, and it may also be used to rename files based on PDF metadata.

[[Edit]] Since this tool still uses Python2, see the other solutions from this article, or try pdftag instead.

This tool allows editing the following PDF meta tags: Author, Title, Year, Keywords and Subject.

Let's install PDFMtEd (PDF Metadata Editor). The tool requires YAD, ExifTool and Qpdf to run, while Git is needed to get the code from its GitHub repository. You may also install Sejda if you wish, an extensible and configurable PDF manipulation layer library that's recommended but not required to run PDFMtEd.

Let's install these (except Sejda, which is not available in the repositories):

  • Debian, Ubuntu, Linux Mint, Pop!_OS, Zorin OS, Elementary OS, and any other Linux distribution based on Debian or Ubuntu:
sudo apt install libimage-exiftool-perl yad qpdf git

  • Fedora:
sudo dnf install perl-Image-ExifTool yad qpdf git

  • CentOS / RHEL:
sudo yum install perl-Image-ExifTool yad qpdf git

  • Arch Linux, Manjaro:
sudo pacman -S perl-image-exiftool qpdf git

You'll need to install YAD from AUR, as it's not in the Arch repositories.

  • openSUSE:
sudo zypper install exiftool yad qpdf git

  • Solus OS:
sudo eopkg install perl-image-exiftool yad qpdf git

You'll also need to have Python2 on your system for this to work.

Now let's clone the PDFMtEd repository and install the application (and also create 3 folders which if are non-existent make the installation fail):

sudo mkdir -p {/usr/local/share/applications,/usr/local/share/icons/hicolor/scalable/apps,/usr/local/bin}

git clone https://github.com/glutanimate/PDFMtEd

cd PDFMtEd

sudo ./install.sh

Warning: never run a script you didn't write without knowing what it does. Before running this script, check out its code.

PDFMtEd

Now to use PDFMtEd, right click a PDF file in your file manager, e.g. Nemo, select Open With -> PDFMtEd - Editor to open open the selected PDF document to be able to edit its metadata tags, or Open With -> PDFMtEd - Inspector to open the PDF document inspector. If it's not listed there, click on Other application and add it from there. With Nautilus for example, right click the file and select Open with other application, then look for PDFMtEd - Editor and PDFMtEd - Inspector.

This is needed because PDFMtEd is not added to the applications menu, and it needs a PDF file as an argument when you run it.

If you can't find PDFMtEd in your file manager Open With options, you may need to restart your session (logout/login).

Users wanting to uninstall PDFMtEd need to run the uninstall.sh script as root (this script is available in the directory where you cloned PDFMtEd), e.g.:

cd PDFMtEd
sudo ./uninstall.sh

PDF-related: How To Convert PDF To Text On Linux (GUI And Command Line)

Edit PDF metadata tags on Linux from the command line


There are multiple tools for Linux that can edit PDF metadata, including ExifTool, pdftk, Ghostview, and probably others, but for this article we'll focus on ExifTool which in my opinion is the easiest to use.

ExifTool is a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in a wide variety of files. For PDF documents, ExifTool supports writing native PDF and XMP metadata; it supports tags like title, author, subject, keywords, creator, and producer, and more.

Install ExifTool on Linux:

  • Debian, Ubuntu, Linux Mint, Pop!_OS, Zorin OS, Elementary OS, and any other Linux distribution based on Debian or Ubuntu:
sudo apt install libimage-exiftool-perl

  • Fedora:
sudo dnf install perl-Image-ExifTool

  • CentOS / RHEL:
sudo yum install perl-Image-ExifTool

  • Arch Linux, Manjaro:
sudo pacman -S perl-image-exiftool

  • openSUSE:
sudo zypper in exiftool

  • Solus OS:
sudo eopkg in perl-image-exiftool

Now you can edit the PDF meta tags on Linux using the ExifTool command line tool (this is a single command):

exiftool -Title="PDF Title" -Author="Author Name" -Subject="PDF Subject" -Keywords="keyword1;keyword2" -Creator="Name of application used to create the PDF" -Producer="PDF producer name or note" myPDFdocument.pdf

What the PDF tags represent in this command should should already be explained by the values I used. Remember to replace myPDFdocument.pdf with the name (and path, if it's not available in the current directory) of the PDF file for which you want to modify the PDF tags.

You can skip some tags I mentioned in this command, in which case the PDF will continue using its original tag (if any). By default, ExifTool creates a backup of the original PDF document, using its name followed by _original. You may skip this, and overwrite the original file by appending -overwrite_original to the command.

You can view a complete list of tags that ExifTool supports for PDF files on this page.

ExifTool may also be used to read the PDF metadata tags. To show all PDF tags with ExifTool, use:

exiftool -all:all myPDFdocument.pdf

It's important to note that the metadata edits made with ExifTool are reversible, which is "a potential security problem because old information is never actually deleted from the file", explains the ExifTool PDF Tags page. You may however permanently remove the old PDF metadata information by using qpdf, with:

qpdf --linearize in.pdf out.pdf

In this command, in.pdf is the PDF file for which you want to remove the old metadata information, and out.pdf is the resulting PDF file name.

PDF-related: How To Create Fillable PDF Forms With LibreOffice Writer