# Failed xfdf downloading

**URL:** <https://pdfjs.community/t/failed-xfdf-downloading/1174>\
**Category:** Technical Support\
**Created:** [November 10, 2021, 3:41am UTC](https://pdfjs.community/t/failed-xfdf-downloading/1174 "2021-11-10T03:41:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![crossbim001](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@crossbim001](https://pdfjs.community/u/crossbim001)\
**Post date:** [November 10, 2021, 3:41am UTC](https://pdfjs.community/t/failed-xfdf-downloading/1174/1 "2021-11-10T03:41:37Z")

</div>

PDF.js Express Plus 8.x.x.

**Detailed description of issue**  
Tried to download pdf with annotations, xfdfs. It happens every document.

**Link to document**

> **[PDFTron](https://www.pdftron.com/documentation/web/guides/get-file-data-with-viewer/#downloading-documents)**
>
> World's #1 PDF SDK Library for Web, Mobile, Server, Desktop

**Code snippet**  
WebViewer(…)  
.then(instance =\> {  
const { documentViewer, annotationManager } = instance.Core;

```
// Add header button that will get file data on click
instance.UI.setHeaderItems(header => {
  header.push({
      type: 'actionButton',
      img: '...',
      onClick: async () => {
        const xfdfString = await annotationManager.exportAnnotations();
        const options = {
          filename: 'myDocument.pdf',
          xfdfString,
          downloadType: 'pdf'
        };
        
        instance.UI.downloadPdf(options);
      }
  });
});

```

})

Would like to know how to download xfdfs.  
Thanks in advance.

Heejung

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [November 10, 2021, 3:41am UTC](https://pdfjs.community/t/failed-xfdf-downloading/1174/3 "2021-11-10T03:41:42Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:
- [PDF.js Express annotations](https://pdfjs.express/documentation/annotation/overview)
- [PDF.js Express Documentation - Annotation](https://pdfjs.express/documentation#annotation-<span-class='plus'></span>)
- [XFDF format - In PDF.js Express Web Viewer](https://pdfjs.express/documentation/annotation/xfdf#in-pdf.js-express-web-viewer)

APIs:
- [Core](https://pdfjs.express/api/Core.html#__anchor)
- [Core.Annotations - setCustomSerializeHandler(annotationClass, serializeHandler)](https://pdfjs.express/api/Core.Annotations.html#.setCustomSerializeHandler__anchor)
- [Core.DocumentViewer - setDocumentXFDFRetriever(retriever)](https://pdfjs.express/api/Core.DocumentViewer.html#setDocumentXFDFRetriever__anchor)

Forums:
- [Confirm output of trial form field merger](https://pdfjs.community/t/confirm-output-of-trial-form-field-merger/744/1)
- [Do annotations from setCustomDrawHandler make it to the downloadable file?](https://pdfjs.community/t/do-annotations-from-setcustomdrawhandler-make-it-to-the-downloadable-file/927/1)
- [Watermark doesn’t get removed after putting license key](https://pdfjs.community/t/watermark-doesnt-get-removed-after-putting-license-key/193/5)

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [November 17, 2021, 3:33pm UTC](https://pdfjs.community/t/failed-xfdf-downloading/1174/4 "2021-11-17T15:33:37Z")

</div>

Hi there!

Sorry for the delay - I was away for a few days (It was a long weekend here in Canada).

The functionality you are trying to do is not supported in PDF.js Express without the use of the rest API.

If you need to merge XFDF into a document, please see [this guide](https://pdfjs.express/documentation/utils/merge).

Thanks!  
Logan

---

<div class="post-metadata">

**Author:** ![crossbim001](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@crossbim001](https://pdfjs.community/u/crossbim001)\
**Post date:** [November 22, 2021, 6:56am UTC](https://pdfjs.community/t/failed-xfdf-downloading/1174/5 "2021-11-22T06:56:44Z")

</div>

Hi Logan,  
We will try it.  
Thank you!

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [November 22, 2021, 8:50pm UTC](https://pdfjs.community/t/failed-xfdf-downloading/1174/6 "2021-11-22T20:50:00Z")

</div>


