Why PDF Page Manipulation Is Technically Interesting
PDFs store pages as individual objects in a tree structure. Each page object contains references to its content streams (the drawing instructions), its resource dictionary (fonts and images used on that page), and its bounding box (the page dimensions).When you reorder or extract pages, you are rearranging these object references in the page tree — not copying the actual content. pdf-lib implements this correctly: it copies page objects and their transitive dependencies (the fonts and images they reference) into the new document, avoiding broken references in the output.
Removing Pages Using the Browser Print Method
The most practical approach for page removal:- Open the PDF in Chrome or Edge browser
- Use Ctrl+P (Print) and select Save as PDF
- In the print dialog, enter the specific page range you want to keep
- The resulting PDF contains only those pages
Reordering a Document
For reordering entire files (for merging multiple PDFs in a specific order), the merger's arrow controls handle this. For reordering individual pages within a single PDF:- Open the PDF in a viewer with page count visibility and note which pages you need
- Print specific page ranges to separate files using Ctrl+P
- Use the Merge PDF tool to combine the sections in your desired order