Skip to content

Python script that joins PDFs using PyPDF2 lib, I use it as a lab rat, trying new functionalities as I learn

Notifications You must be signed in to change notification settings

brunompasini/pdfjoin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

usage: pdfjoin2.py [-h] [-n NAME] files [files ...]

python modules used:

  • datetime
  • argparse
  • typing
  • PyPDF2

function list:

  • join(name: str, to_join: List[str]):
    checks every element in 'to_join' and if not there, adds a .pdf ending, same thing with 'name'
    PdfFileMerger object is instatiated, it'll do the work to join all files added with append, after we just pick the name argument passed, write the pdf file and close the file.

  • main():
    default_name is:
    'result_PDF_dd_mm_yyyy_hh_mm.pdf' (date in day, month, year, hour and minute)
    after we start the Argument Parser, there's a
    -> help arg,
    -> name arg (optional, if blank uses default name)
    -> file list entry arg
    after all, the join function is called with the right parameters

Works with PyPDF2==1.26.0, try pip installing it: 'pip install PyPDF2'

About

Python script that joins PDFs using PyPDF2 lib, I use it as a lab rat, trying new functionalities as I learn

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages