Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@harajune
Created May 20, 2022 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harajune/8cc3690bd016e1c66832247e6c8e9481 to your computer and use it in GitHub Desktop.
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