# Server side merge in Ruby

**URL:** <https://pdfjs.community/t/server-side-merge-in-ruby/1383>\
**Category:** Technical Support\
**Created:** [February 14, 2022, 9:11pm UTC](https://pdfjs.community/t/server-side-merge-in-ruby/1383 "2022-02-14T21:11:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lawing](https://avatars.discourse-cdn.com/v4/letter/l/bbe5ce/32.png) [@lawing](https://pdfjs.community/u/lawing)\
**Post date:** [February 14, 2022, 9:11pm UTC](https://pdfjs.community/t/server-side-merge-in-ruby/1383/1 "2022-02-14T21:11:28Z")

</div>

**Which product are you using?**  
PDF.js Express Plus

**PDF.js Express Version**  
8.2

**Detailed description of issue**  
We are trying to implement XFDF merging on the server side in a Ruby on Rails application. All requests result in error 20, Invalid Input, and we always pass the file in URL form.  
What is the exact request payload like? Can someone please provide a CURL example?

**Expected behaviour**  
XFDF annotations should be merged.

**Does your issue happen with every document, or just one?**  
All documents we tried, including known working ones.

**Link to document**

> **[dummy.pdf](https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf)**
>
> 12.95 KB

**Code snippet**  
Request is multipart using Faraday.

---

<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:** [February 14, 2022, 9:11pm UTC](https://pdfjs.community/t/server-side-merge-in-ruby/1383/3 "2022-02-14T21:11:31Z")

</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:
- [Rich text](https://pdfjs.express/documentation/annotation/rich-text.8)
- [Flatten Annotations](https://pdfjs.express/documentation/advanced/flatten-annotations)
- [Merging XFDF using the Express REST API - Body params](https://pdfjs.express/documentation/utils/merge#body-params)

APIs:
- [ExternalAnnotationMerger - getTransformFunction()](https://pdfjs.express/api/7.0/ExternalAnnotationMerger.html#getTransformFunction__anchor)
- [Core.Annotations.FileAttachmentAnnotation - new FileAttachmentAnnotation( [initializer])](https://pdfjs.express/api/Core.Annotations.FileAttachmentAnnotation.html#FileAttachmentAnnotation__anchor)
- [Core.DocumentViewer - setDocumentXFDFRetriever(retriever)](https://pdfjs.express/api/Core.DocumentViewer.html#setDocumentXFDFRetriever__anchor)

Forums:
- [Merging XFDF using the Express REST API](https://pdfjs.community/t/merging-xfdf-using-the-express-rest-api/105/1)
- [Importing XFDF data](https://pdfjs.community/t/importing-xfdf-data/99/1)
- [Annotations moving on downloaded pdf when opened in Abode Acrobat and BLUEBEAM](https://pdfjs.community/t/annotations-moving-on-downloaded-pdf-when-opened-in-abode-acrobat-and-bluebeam/1009/6)

---

<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:** [February 16, 2022, 4:07pm UTC](https://pdfjs.community/t/server-side-merge-in-ruby/1383/4 "2022-02-16T16:07:00Z")

</div>

Hey there,

Can you please provide a code snippet showing how you are sending the request? If you could also log the payload that would be useful.

Thanks,  
Logan
