How to export annotations in XFDF format from the console in WebViewer

Export the annotation data from WebViewer in the Chrome developer console

Q: What is XFDF?
A: According to the XFDF specification:-

XFDF (XML Forms Data Format) is a format for representing forms data and annotations in a PDF document. XFDF is the XML version of Forms Data Format (FDF), a simplified version of PDF for representing forms data and annotations.

  1. Open the Chrome developer console. You can press either command + option + j on Mac, or control + shift + j on Windows.

  2. If you’re using an older version switch the console to be in the context of WebViewer. To do this, click the dropdown at the top of the console and switch it to the index.html iframe.

  3. Type the following command in the console and press enter.

    const annotationManager = instance.Core.annotationManager;
    copy(await annotationManager.exportAnnotations());
    
  4. You can then send us the XFDF through a text file or copying and pasting it into the support ticket.