Some test text!

menu
Remove pageskeyboard_arrow_down

Removing pages from PDF using JavaScript

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

WebViewer(...)
  .then(instance => {
    const { docViewer } = instance;

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

      docViewer.getPageCount(); // 3

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

Get the answers you need: Support

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.