# Merging XFDF using the Express REST API length exceeded error

**URL:** <https://pdfjs.community/t/merging-xfdf-using-the-express-rest-api-length-exceeded-error/185>\
**Category:** Technical Support\
**Created:** [August 13, 2020, 5:07am UTC](https://pdfjs.community/t/merging-xfdf-using-the-express-rest-api-length-exceeded-error/185 "2020-08-13T05:07:42Z")\
**Posts on this page:** 1\
**Showing post:** 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:** [August 18, 2020, 4:07pm UTC](https://pdfjs.community/t/merging-xfdf-using-the-express-rest-api-length-exceeded-error/185/5 "2020-08-18T16:07:30Z")

</div>

So the issue actually isn’t with the server like I thought. PDF.js Express can not import annotations baked into a document, and instead just renders these annotations as flattened bitmaps. There seems to be a regression here where this is not working all the time, which is why the merged annotations do not show up.

In order to load annotations, you need to use the [importAnnotations](https://pdfjs.express/api/CoreControls.AnnotationManager.html#importAnnotations__anchor) API and provide the XFDF (which can be retrieved either from your database, or our /extract endpoint).

Right now your flow is a bit strange because you are merging annotations into a document and then directly reopening it (meaning it would flatten the merged annots).

We will look into this annotation rendering regression ASAP, but for now we recommend that the /merge endpoint only be used when delivering the document to the user (via download etc).

Let me know if there are any more questions.

Thanks,  
Logan

---

_[View the full topic](https://pdfjs.community/t/merging-xfdf-using-the-express-rest-api-length-exceeded-error/185)._
