How to merge multiple PDF files into one
Put at least two Base64-encoded PDF files into the order you want, then process the list to receive one combined PDF. A successful response also includes the number of files combined and pages processed.
When to combine PDF documents
A PDF merger is useful when separate documents need to become one file, such as a report assembled from sections, a submission packet, or an introduction followed by an appendix. This tool combines at least two supplied Base64-encoded PDF files into one PDF document when processing succeeds. The sequence is controlled by the order of the files you provide, while the pages inside each file retain their existing order. Before starting, gather the PDF values and decide which document should appear first. The result is intended for situations where the source files are already available in a form the tool can decode and read.
Steps for a correctly ordered merge
-
Prepare at least two PDF values. Each supplied value must represent a PDF encoded as Base64. A single value cannot satisfy the minimum needed for a successful merge.
-
Arrange the values in one ordered list. Place the first document at the beginning, followed by the next document and the remaining files in their intended sequence. The first file contributes the opening pages, and each later file follows it.
-
Start processing the list. The tool decodes each value and reads it as a PDF before adding its pages to the combined document. If no usable list is provided, processing proceeds with an empty list and does not succeed.
-
Inspect the operation status. A successful operation returns the combined PDF as a Base64-encoded value, together with counts for the files combined and pages processed. If fewer than two files are available, a supplied value cannot be read as a PDF, the PDF dependency is unavailable, or another processing exception occurs, the operation reports failure with an error message.
-
Use the returned document. Decode the returned Base64 value when you need the resulting PDF representation. Compare the reported file count with the number of supplied files, then compare the page count with the pages you intended to include.
Reading the returned PDF and counts
A successful result has two useful parts: the combined PDF encoded as Base64 and counts describing the processing. The file count indicates how many supplied files were combined, while the page count indicates how many pages were processed. Use those values to check that the input list represented the intended set of documents.
The document sequence should be predictable from the input. Pages from the first file come before pages from the second, and the original page sequence inside each source remains in place. A failure indicates that the operation did not produce a successful combined document. Check the number of supplied files, confirm that each value represents a readable Base64 PDF, and review the reported processing error before trying again. After a successful merge, adding page numbers can be a practical follow-up when the combined document needs navigable page labels.
Worked example
You have a two-page introduction and a three-page appendix and want the introduction to appear before the appendix in one PDF.
Provide a two-page PDF followed by a three-page PDF, process the ordered list, and inspect the returned document and counts.
A successful result contains one combined PDF encoded as Base64 and reports 2 files combined and 5 pages processed.
Limitations
- The merge depends on at least two readable Base64 PDF values; an unreadable value, unavailable PDF dependency, or processing exception can result in failure instead of a combined document.
Common errors
- A list with one file, no usable list, or a value that cannot be read as a PDF causes processing to fail; provide at least two readable Base64-encoded PDF values in the intended order and try again.
FAQ
How many PDF files do I need to merge?
At least two supplied PDF files are needed for a successful operation, so one file by itself does not meet the minimum.
Does the merger preserve PDF page order?
The merger places files in the sequence you submit them and keeps the page sequence found inside each file.
What does the successful result contain?
When processing succeeds, the response contains the combined PDF as Base64 together with counts for the processed pages and combined files.