Skip to content

Instantly share code, notes, and snippets.

View HeimMatthias's full-sized avatar

HeimMatthias

  • hep Verlag AG
  • Bern, Switzerland
View GitHub Profile
@mid-kid
mid-kid / pdf-full-merge.js
Last active August 21, 2025 08:14
Merge all attributes of multiple PDF files using MuPDF
// Merge all attributes of multiple PDF files (pdf-full-merge.js)
// Extended from MuPDF's docs/examples/pdf-merge.js
// Ever had problems with tools that don't copy certain attributes of a PDF?
// This script uses MuPDF to merge/join/concatenate as much as possible, including:
// - bookmarks / outlines / table of contents
// - link attributes of said outlines, such as viewrect and zoom
// - whether outlines appear open or closed by default
// - annotations, including links
// - 3d objects / PDF3D