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 »

DevLaunch

Overview I built a free modern SaaS landing page template using pure HTML, CSS & JS. Open source. - Repository: https://github.com/Haseeb-MernStack/devlaunch-m...