Skip to content

Instantly share code, notes, and snippets.

@harajune
Created May 20, 2022 11:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save harajune/8cc3690bd016e1c66832247e6c8e9481 to your computer and use it in GitHub Desktop.
class PdfMerger:
def __init__(self, outputFileName):
self._merger = PdfFileMerger()
self._outputFileName = outputFileName
def append(self, pdf):
self._merger.append(fileobj=pdf.fileObject, pages=(pdf.currentPage, pdf.currentPage + 1))
def write(self):
self._merger.write(self._outputFileName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment