PDF documents often contain blank filler sheets, outdated terms, or redundant pages that need to be removed before sharing. For macOS users, the built-in Preview application is the standard utility for editing PDF structures. However, Preview can be slow when processing large files, and it doesn't support batch deletions. In this guide, we will analyze how to delete pages from PDF on Mac Preview step-by-step, discuss the file-bloat issues associated with Preview, and explore client-side browser alternatives that rebuild documents cleanly.

How to Delete PDF Pages in Mac Preview

To remove pages from a PDF document using Preview, follow these steps:

  1. Double-click your PDF file to open it in Preview.
  2. Click the View menu at the top of the screen and select Thumbnails (or press Option + Cmd + 2).
  3. In the sidebar thumbnail list, select the page you want to delete. To select multiple pages, hold down Cmd and click each page thumbnail.
  4. Press the Delete key on your keyboard, or go to the Edit menu and select Delete. The selected page thumbnails will disappear.
  5. Go to the File menu and select Save (or press Cmd + S) to write the changes back to the file.

This process is standard for simple documents. However, for files with hundreds of pages, manually scrolling and selecting thumbnails is inefficient.

The "Bloated Size" Problem in macOS Preview

A common technical issue with macOS Preview is that deleting pages does not always reduce the file size. For example, if you delete 50 pages of images from a 100-page scan, the saved file may still be just as heavy as the original.

This happens because Preview uses incremental saving. Instead of rebuilding the PDF structure from scratch, it appends changes to the end of the file. The pages are marked as hidden, but the heavy image binaries and fonts remain inside the PDF structure (orphaned objects).

To fix this file-bloat issue and force Preview to compile the document from scratch, you must export the document after deleting the pages:

  1. Delete the unwanted pages in Preview.
  2. Go to the File menu and select Export as PDF...
  3. Choose a new filename and click save. Preview will rebuild the PDF layout and purge the unused image structures, reducing file size.

Understanding Orphaned Objects in PDF Byte Streams

The PDF structure consists of a series of indirect objects (numbered dictionary elements) indexed in a cross-reference table (xref) at the end of the file. When you delete a page in Preview, the catalog's Page Tree kids array is updated to remove that page's reference index.

However, the actual indirect objects representing the deleted page's content stream, fonts, and large images (known as /XObject maps) are not physically deleted from the file. They remain as "orphaned objects" because Preview does not execute garbage collection.

To clean this up programmatically, you can run a Ghostscript post-processing script that parses and garbage-collects all orphaned elements:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Using TinyWeb's local browser page tools automatically performs this rebuilding and garbage collection process via PDF-Lib in WebAssembly, giving you optimized, lightweight files.

A Faster Alternative: In-Browser Page Deletion

If you want a cross-platform tool that automatically cleans up deleted page bytes, you can use a browser-based utility like TinyWeb's Split PDF Online.

  1. Open Safari or Chrome and navigate to the Split PDF page on TinyWeb.
  2. Drag your PDF document into the page. The local script parses the page structure.
  3. Select the Split by Range option and input the page numbers you want to keep (e.g. if you want to delete page 6, input 1-5, 7-10).
  4. Click Split PDF. The tool compiles a new PDF stream locally, automatically purging all unused assets and downloading a clean, optimized file.

Because all processing happens in your browser's local sandbox, your documents are never uploaded to a cloud server, meeting strict privacy and enterprise data policies.

Command-Line Page Deletion (QPDF & PDFtk)

For automation scripts or developers working on server backends, command-line tools are the most efficient way to delete pages locally.

Example using QPDF:

To delete pages 6 and 7 of a 10-page document, run:

qpdf input.pdf --pages input.pdf 1-5,8-10 -- output.pdf

Example using PDFtk:

To output a PDF excluding page 6:

pdftk input.pdf cat 1-5 7-end output output.pdf

Conclusion

Deleting pages in Mac Preview is easy using the thumbnail sidebar, but you should remember to use "Export as PDF" to prevent file bloat. For batch deletions or cross-platform workflows, client-side browser tools like TinyWeb offer a secure, local alternative that rebuilds documents cleanly without server uploads.

How PDF Document Structure is Rebuilt in Memory

To understand why deleting pages in Preview results in bloated files, we must look at how objects are indexed inside a PDF. A PDF is essentially a flat database of indirect objects, each assigned an object ID and a generation number (e.g., 12 0 obj). The cross-reference table (xref) at the end of the file maps these IDs to their exact byte offsets.

When you delete a page in a client-side tool like TinyWeb, the library reads the document catalog and recursively builds a list of "referenced objects." It starts from the root catalog dictionary, traces the /Pages tree, and gathers all the indirect objects that are actively linked. When a page is deleted, its reference is removed from the Kids array. During serialization, the library writes out a completely new cross-reference table containing ONLY the referenced objects. Any unused elements (like the deleted page's contents or image streams) are ignored, resulting in a clean garbage collection and a significantly smaller output file size.

Programmatic Page Deletion in Node.js

You can easily automate PDF page deletion locally using pdf-lib. Below is a code example showing how to load a PDF, remove the second page (index 1), and save the optimized output:

const { PDFDocument } = require('pdf-lib');
const fs = require('fs');

async function removePageFromPdf(inputPath, outputPath, pageIndexToRemove) {
    // Load the original PDF document
    const pdfBytes = fs.readFileSync(inputPath);
    const pdfDoc = await PDFDocument.load(pdfBytes);
    
    // Remove the page at the specified index
    pdfDoc.removePage(pageIndexToRemove);
    
    // Serialize the document. PDF-Lib automatically rebuilds
    // the xref table and purges orphaned objects during save.
    const savedBytes = await pdfDoc.save();
    
    fs.writeFileSync(outputPath, savedBytes);
    console.log('Page deleted and PDF optimized successfully!');
}

// Example: Delete the second page (index 1)
removePageFromPdf('source.pdf', 'cleaned.pdf', 1);