# URGENT - XFDF Merge API giving \[500\] internal server error

**URL:** <https://pdfjs.community/t/urgent-xfdf-merge-api-giving-500-internal-server-error/2331>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [January 31, 2023, 5:08pm UTC](https://pdfjs.community/t/urgent-xfdf-merge-api-giving-500-internal-server-error/2331 "2023-01-31T17:08:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![devops1](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@devops1](https://pdfjs.community/u/devops1)\
**Post date:** [January 31, 2023, 5:08pm UTC](https://pdfjs.community/t/urgent-xfdf-merge-api-giving-500-internal-server-error/2331/1 "2023-01-31T17:08:05Z")

</div>

**Which product are you using?**

PDF.js Express Plus

**PDF.js Express Version**  
v8.7.0

**Detailed description of issue**  
There is an issue with the merge function provided by `@pdftron/pdfjs-express-utils`.  
Some users, using chrome & edge browsers are getting 500 Internal server errors while our web app uses the `merge` function which results in a PDFExprress API call of `/merge`.

Hi PDF JS Express team,  
I’m writing given an unexplainable 500 error we are receiving with a small set of users. We can’t figure out if it’s our error or a bug with PDF JS Express software. We’ve now had a few users report this issue — can you please help us debug it?

I’m attached a few screenshots and will try to explain the issue. After the PDF form load inline (with annotations filled in) — and we go to “Save” the form, we’re receiving a 500 “merge” error. The details are attached below — showing a more detailed message saying “server-side request must use server-side key.”  
Please let us know how this can be resolved.

Issue

**Expected behaviour**  
The `merge` function leads to the PDFExprress API call of `/merge` to work on all client’s chrome browsers.

**Does your issue happen with every document, or just one?**  
Only some of the users are facing this issue, same form/pdf is working for other users.

**Link to document**

**Code snippet**

```javascript
/**
   * Returns file for edited PDF.
   * @returns {Blob}
   */
  async getPdfFileData() {
    const { documentViewer, annotationManager } = this.webViewer.Core;
    const utils = new ExpressUtils(PDFJS_EXPRESS_UTIL_OPTIONS);

    const xfdf = await annotationManager.exportAnnotations({});
    const fileData = await documentViewer.getDocument().getFileData({});

    const resp = await utils.setFile(fileData).setXFDF(xfdf).merge();

    const mergedBlob = await resp.getBlob();

    return mergedBlob;
  }

```

---

<div class="post-metadata">

**Author:** ![devops1](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@devops1](https://pdfjs.community/u/devops1)\
**Post date:** [January 31, 2023, 5:08pm UTC](https://pdfjs.community/t/urgent-xfdf-merge-api-giving-500-internal-server-error/2331/3 "2023-01-31T17:08:42Z")

</div>

**Screenshots:**

 ![image (2)](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/6/63c02fce08776db6d857d56d8d243342731fe6ea.png)  
 ![image (3)](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/8/85d4d0b9dcd4fb3843a6d6b72fed2651b75ea6c1.png)  
 ![image (4)](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/f/f1f5c4061a9fc71212bfe30e288adda4b48016ed.png)  
 ![image-2](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/5/52a55438b86bf2d8f1fed4886fc3f9c56d235933.png)  
 ![image (2)](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/6/63c02fce08776db6d857d56d8d243342731fe6ea.png)

---

<div class="post-metadata">

**Author:** ![zserviss](https://avatars.discourse-cdn.com/v4/letter/z/a9a28c/32.png) [@zserviss](https://pdfjs.community/u/zserviss)\
**Post date:** [February 1, 2023, 3:33pm UTC](https://pdfjs.community/t/urgent-xfdf-merge-api-giving-500-internal-server-error/2331/5 "2023-02-01T15:33:11Z")

</div>

Is it possible that some of the users are using a proxy?

Best Regards,  
Zach Serviss  
Platform Support Engineer  
PDFTron Systems, Inc.

---

<div class="post-metadata">

**Author:** ![Bitbean](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@Bitbean](https://pdfjs.community/u/Bitbean)\
**Post date:** [July 7, 2025, 3:49pm UTC](https://pdfjs.community/t/urgent-xfdf-merge-api-giving-500-internal-server-error/2331/6 "2025-07-07T15:49:54Z")

</div>

Hi,  
We are experiencing this same issue for users with network proxies. Wondering if there’s any way to work around the issue to avoid forcing users to eliminate the proxy.  
Thanks
