DEV CommunityWednesday · June 17, 2026FREE

pdf-pagenum: Fix Messy macOS Preview Page Numbers in PDFs from the CLI

pdfclimacospreview

The article introduces pdf-pagenum, a command-line tool designed to fix incorrect page numbers in PDFs when opened with macOS Preview. Preview often misreads or displays garbled page numbers due to how it interprets PDF metadata. The tool allows developers to correct these numbers directly from the terminal, streamlining the process of preparing PDFs for distribution or review. By using pdf-pagenum, users can ensure that page numbers appear correctly in Preview without needing to open the file in a full PDF editor. The tool is available for installation via npm and is intended for developers who work with PDFs in automated workflows or need to batch-fix page numbers. The article does not specify the exact version of the tool or provide benchmark performance data, but it emphasizes the utility of the tool for macOS users who rely on Preview for document viewing.

// why it matters

Developers can automate PDF page number fixes for macOS Preview, saving time in document preparation workflows.

Sources

Primary · DEV Community
▸ Read original at dev.to

Like this? Get the next digest.