pdftk is GOAT

Published: (February 8, 2026 at 12:37 AM EST)
1 min read
Source: Dev.to

Source: Dev.to

Introduction

I need a free, open‑source PDF editor for Linux. Previously I used a Foxit Editor subscription on Windows just to edit PDF bookmarks, even though I work on Linux daily. A quick search led me to pdftk, which turned out to be an absolute masterpiece for handling PDF metadata.

Dump PDF metadata

pdftk random.pdf dump_data_utf8 output output.txt

This command extracts the PDF’s metadata (including bookmarks) into output.txt.

Edit bookmarks

Open output.txt and locate the BookmarkBegin sections. Edit the existing entries or, if a bookmark is missing, append a new block at the end of the file—one block per bookmark:

BookmarkBegin
BookmarkTitle: Bookmark Title
BookmarkLevel: 1
BookmarkPageNumber: 1

Save the file after making your changes.

Apply the new metadata

pdftk random.pdf update_info_utf8 output.txt output output.pdf

This command writes the edited metadata back into the PDF, producing output.pdf.

Using pdftk is far faster than my previous workflow.

0 views
Back to Blog

Related posts

Read more »

Day 5: The Guidance arrives... Finally!

Getting Started with GNOME Contributions First of all, thanks for reading! After a long period of feeling ignored by maintainers—​not because they don’t pay at...

Basics & History of Linux

UNIX Origins - 1964 – Bell Laboratories New Jersey began the UNIX project. - 1969 – The original project was withdrawn, but Dennis Ritchie and Ken Thompson con...