Merge XFDF and file data gets error with large file

// Get the annotations and the documents data
var xfdf = await instance.annotManager.exportAnnotations({ links: false, widgets: false });
var fileData = await instance.docViewer.getDocument().getFileData({});
// Set the annotations and document into the Utility SDK, then merge them together
var resp = await utils.setFile(fileData).setXFDF(xfdf).merge();
// Get the resulting blob from the merge operation
var mergedBlob = await resp.getBlob();

This is my code to merge XFDF and file data
It’s work properly with small files but when I select large size file (19 MB) It is not working, throws an error.

I also tried with API which gives below error

Please Provide solution for this.

Hello, I’m Ron, an automated tech support bot :robot:

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


Hi Steven,

The max request size for the API is 5.5MB, which is why that error is happening. If you want to merge PDFs larger than that, you will have to upload them to a server (Amazon S3 for example) and provide a URL to the PDF instead of sending the raw data.


This worked. I was able to use this API PDF.js Express Utils Home

Thank you.