Here's a Python script that takes all PDF files in a folder and merges them into a single file without using PyPDF2
:
main.py1586 chars46 lines
The merge_pdfs()
function takes the path to the directory containing the PDF files, and the path to the output file. It opens each PDF file in the directory one by one, extracts the text content from each page and writes it into the output file.
Note: This approach only merges the text content of the PDF files, not the raw PDF contents. Hence, any images or complex PDF elements are not maintained.
gistlibby LogSnag