Skip to content

A utility for automatically combining and trimming PDF files

License

Notifications You must be signed in to change notification settings

nhansendev/PDFCombine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PDFCombine

A python 3 utility for automatically combining and trimming PDF files

Main Functions

Combine PDFs

Stack multiple PDFs together into one large PDF

image

Combine Pages

Stack multiple pages (configurable) onto one page to reduce page count and make printing easier

image

Trim PDFs

Remove pages using manually defined page ranges, and/or by auto-recognizing the References page of scientific papers

image

Requirements:

Python 3.11

pip install -r requirements.txt
  • pdfrw
  • pdfplumber

Usage

Terminal

python CombinePDFs.py <directory with PDFs> <new filename> <pages per page> ... (other args shown below)

In Python

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, 
)

About

A utility for automatically combining and trimming PDF files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages