View pdf_merge.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import re | |
from pathlib import Path | |
from PyPDF2 import PdfMerger | |
from PyPDF2.errors import PyPdfError | |
def parse_pages(pages_list, files): | |
# no ranges => select all pages | |
# "None" means "all pages" in pypdf2 |