Some test text!

menu
search

Removing pages

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

WebViewer(...)
  .then(function(instance) {
    var docViewer = instance.docViewer;

    docViewer.on('documentLoaded', function() {
      var doc = docViewer.getDocument();
      var page1 = 1, page2 = 2, page3 = 3;

      docViewer.getPageCount(); // 3

      doc.removePages([page2]).then(function(pagesArray) {
        // at this point page 2 has been removed from the document
        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.

PDFTron Receives USD$71 Million Growth Investment Led By Silversmith Capital Partners

Learn more
close