Merging multiple PDFs seems to be a common request, and most people don’t want to spend a small fortune on a tool to do the merging. I first looked at this problem with an early Python project (https://geektechstuff.com/2018/02/17/python-3-merge-multiple-pdfs-into-one-pdf/) and later improved on that project by adding a simple GUI (https://geektechstuff.com/2018/07/04/pdf-merge-with-gui-v2-python/).
Now I have gone a step further and created the PDF merge tool in a Flask powered website. I’ve even created the relevant Docker file so that it can be containerised if needed.
Note: I’m using this in my development environment, if you are going to make it live in a production environment make sure to tidy up some of the features / security etc.

Python:
——


Running the site:

To run the site copy the files from my Github (link below) and save them into a folder (something like “geektechstuff_pdf_merge_flask”), via the terminal navigate into the folder and either run:
FLASK_APP=pdfmerge.py flask run
Then open a web browser and navigate to the appropriate host (Flask will say what address:port it is running on).
OR
build the included Docker file and run the container in Docker.
The files for this project can be found on my Github: https://github.com/geektechdude/Python_PDF_Merge_Flask_Site
Notes (Or things I need to sort in next version):
- Get it to clear any uploaded PDFs on merge completion
- Get it to clear any created PDFs after a time frame
- Tidy up HTML and make it look better
One thought on “PDF Merge Website (Python)”
Comments are closed.