Extracting pages from a document is not working

Product: webviewer sdk

Product Version: 10.11

Please give a brief summary of your issue:
Extracting pages from a document is not working , as we approached the same way how you have in your documentation.

Please describe your issue and provide steps to reproduce it:

Extracting pages from a document is not working , as we approached the same way how you have in your documentation.

const { documentViewer, annotationManager } = instance.Core;

documentViewer.addEventListener('documentLoaded', async () => {
  const doc = documentViewer.getDocument();
  const pagesToExtract = [2, 3];

  // only include annotations on the pages to extract
  const annotList = annotationManager.getAnnotationsList().filter(annot => pagesToExtract.indexOf(annot.PageNumber) > -1);
  const xfdfString = await annotationManager.exportAnnotations({ annotList });
  const data = await doc.extractPages(pagesToExtract, xfdfString);
  const arr = new Uint8Array(data);

  //optionally save the blob to a file or upload to a server
  const blob = new Blob([arr], { type: 'application/pdf' });
});

Please provide a link to a minimal sample where the issue is reproducible:

1 Like

Hello vishnuvardhan,

Thank you for reaching out!

This is not enough information for us to reproduce this issue, if you could provide a sample project that would be best.

Also if you could provide if there are any other errors or network errors that are occurring as this error is typically shown if the workers arent found or arent started.

Best regards,
Tyler

1 Like