Some test text!

Loading...
Guides
Remove pages

Removing pages from PDF using JavaScript

Pages can be removed from the PDF document using the removePages function.

// config.js
const { documentViewer } = instance.Core;

documentViewer.addEventListener('documentLoaded', async () => {
  const doc = documentViewer.getDocument();
  const page1 = 1, page2 = 2, page3 = 3;

  documentViewer.getPageCount(); // 3

  await doc.removePages([page2]);
  documentViewer.getPageCount(); // 2
})

Get the answers you need: Support

Upcoming Webinar: SDK Features Preview and Live Run-Through | July 14, 2022 at 11 am PT

PDFTron SDK

The Platform

NEW

© 2022 PDFTron Systems Inc. All rights reserved.

Privacy

Terms of Use