1001fx - NoCode functions icon

1001fx - NoCode functions

1001fx is a set of functions for any automation platform. Our functions are simple, very well tested, scalable and offer features that most automation platforms do not offer.

Actions74

files → Merge PDFs

AI-generated

Overview

The Merge PDFs operation under the files resource allows you to combine multiple PDF files into a single PDF document. This is particularly useful in scenarios where you need to consolidate reports, invoices, or any other documents that are split across several PDF files. For example, you might use this node to merge monthly statements into a quarterly report, or to append signature pages to contracts.

Properties

Name Meaning
PDF file 1 The first PDF file to be merged. (Required)
PDF file 2 The second PDF file to be appended to the first. (Required)
PDF file 3 An optional third PDF file to be appended after the second.
Binary Property The name of the binary property where the resulting merged PDF will be stored. (Required; default: data)

Output

  • Binary Data:
    The output contains a binary field (with the name specified by "Binary Property") holding the merged PDF file.
  • json:
    The json field will contain the original input JSON data. If an error occurs and "Continue On Fail" is enabled, the json field will include an error key with details about the failure.

Example Output Structure:

{
  "json": { /* original input data */ },
  "binary": {
    "data": {
      "data": "<Buffer ...>", // The merged PDF as a binary buffer
      "fileName": "merged.pdf",
      "mimeType": "application/pdf"
    }
  }
}

(The actual binary property name may differ if you set a custom value for "Binary Property".)

Dependencies

  • External Service: Requires access to the 1001fx API.
  • API Key: You must configure the 1001fxApi credential in n8n.
  • n8n Configuration: Ensure the node has access to binary data inputs for the PDF files to be merged.

Troubleshooting

  • Common Issues:

    • Missing Binary Data: If the specified PDF files are not present in the binary input, the node will fail.
    • Invalid File Format: Only valid PDF files should be provided; otherwise, merging will fail.
    • Large Files: Merging very large PDFs may result in timeouts or memory issues.
  • Error Messages:

    • "Cannot read property 'fileName' of undefined": Indicates that one of the required PDF files was not found in the binary input. Check your input mapping.
    • "Request failed with status code 401": Your API credentials are missing or incorrect.
    • "Unexpected token < in JSON at position 0": The response from the API is not valid JSON, possibly due to a server-side error or invalid input.

Resolution Steps:

  • Double-check that all required PDF files are attached as binary properties.
  • Verify your API credentials in n8n.
  • Ensure the "Binary Property" matches the property name you want the output in.

Links and References

Discussion