We're sorry AsposeCloud doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.cloud

Merge PDF documents in Node.js with Aspose.PDF REST API throws Gateway Time-out

Hi there,

I’m using the Node SDK to merge PDF files using putMergeDocuments. When invoking it, the method works as expected and it does merge the files. However, it takes a lot of time to receive a response (I’d say around 5 minutes), and the response I receive is a 504 gateway time-out.

I have tried Dropbox and Internal storage, in both cases files are merged but the response is the same. Any way to avoid this long response? As it really slows down the workflow.

I look forward to your reply.



We are sorry for the inconvenience. Please share your sample documents along with the code. We will try to reproduce the issue at our end and guide you accordingly.

Hi Tilal, thank you for looking into this. Please find a code sample I made to merge PDF documents in Node.js, I just tested it and the behavior is the same:

const { PdfApi } = require("asposepdfcloud");
const { MergeDocuments } = require("asposepdfcloud/src/models/mergeDocuments");

pdfApi = new PdfApi("xxxxxxxxxxxxxxxxxx", 

const modules = ['combineFilesInput1.pdf','combineFilesInput2.pdf','combineFilesInput3.pdf'];
const resultName = 'Output.pdf';
const mergeDocuments = new MergeDocuments();
mergeDocuments.list = [];

modules.forEach((file) => {

pdfApi.putMergeDocuments(resultName, mergeDocuments, null, null)
    .then((result) => {

For the record, I am using Dropbox as storage.

combineFilesInput1.pdf (939.7 KB)
combineFilesInput2.pdf (6.9 MB)
combineFilesInput3.pdf (187.9 KB)

Upon trying several times using the same files and code, I noticed that the behavior isn’t consistent. It always combines the files and the response sometimes is 200 ‘OK’ but most of the time is 504 gateway timeout.

This is the only step I am missing to be able to fully implement your service into my workflow so I am very much looking forward for a solution.


We have noticed the reported issue with your shared documents and opened the following new ticket(s) in our internal issue tracking system. We will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFCLOUD-3336

You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as PDFCLOUD-3336) have been fixed in this update. This message was posted using Bugs notification tool by andrey.kaferi