A python 3 utility for automatically combining and trimming PDF files
Stack multiple PDFs together into one large PDF
Stack multiple pages (configurable) onto one page to reduce page count and make printing easier
Remove pages using manually defined page ranges, and/or by auto-recognizing the References page of scientific papers
Python 3.11
pip install -r requirements.txt
- pdfrw
- pdfplumber
python CombinePDFs.py <directory with PDFs> <new filename> <pages per page> ... (other args shown below)
from CombinePDFs import combine_pdfs
# default kwargs shown
combine_pdfs(
path,
new_filename="combined.pdf",
pages_per_page=4, # can be any integer >= 1
subset=None, # which specific PDFs in the directory should be combined?
exclude=None, # which specific PDFs in the directory should be ignored?
page_subsets=None, # in the same order that the PDFs are found, list their page ranges to use
remove_refs=True, # try to automatically find and remove all pages after the "References" page
scaler=0.92, # sets the spacing between PDFs on the same page
verbose=True,
)