Merge PDF Files in Python
Contents
[
Hide
]
Merge PDF Files using Python and DOM
To concatenate two PDF files:
- Create a New Document.
- Merge the PDF Files
- Save the Merged Document
Combining multiple PDF documents into a single file:
import sys
import aspose.pdf as ap
from os import path
def merge_two_documents(infile1, infile2, outfile):
document1 = ap.Document(infile1)
document2 = ap.Document(infile2)
document1.pages.add(document2.pages)
document1.save(outfile)
Live Example
Aspose.PDF Merger is an online free web application that allows you to investigate how presentation merging functionality works.
