How to merge multiple PDF files using Python | Python Tutorial

preview_player
Показать описание
In this tutorial, we are going to learn how to merge PDF files using #PyPDF2 in Python.

Portable Document Format (PDF) is probably the most widely used file format when it comes to creating document today. By default, most PCs don't come with PDF files merge/combine feature, and if your #PDF file has sesnitive information, you are running into security risk when using free online tools or 3rd party software. So creating your own Python program to perform PDF files merge task is the safest solution, and the script only takes less than 2 minutes to write.

Buy Me a Coffee? Your support is much appreciated!
Venmo: @Jie-Jenn

To Get Source Code Used:

More tutorial videos on my website

Considering support my channel through shopping on Amazon

Want to be more productive? Check out the the gear (Amazon affiliate links) I use when I am working.
Рекомендации по теме
Комментарии
Автор

Hi can you help me? The output file type is not a pdf file. And it says there are no pages in the file. 🙁

bgjohngarcia
Автор

The source_dir: what if the PDF files to be sorted are not in the same folder 📂 as the python files...

I did it this way and I'm getting error that a file is missing. Any suggestion???

a-factoracademy
Автор

Jie Jenn, how did the File "C:\Users\....PDF" come up?

nareshpadmanaban
Автор

it works for me and i am getting the output but when i try to open, it says that my pdf file is corrupted
ANY FIX?

harmaansinghsohal
Автор

From now on rather than downloading apps, I'm hopping on that python IDE.

augustohernandezrubio
Автор

Hi sir I got topic of combining select pages from many pdfs word documents python project
Can u pls guide me a little plssss

supriya
Автор

Hi, thanks for the great sharing. I would like to know what if the files has password, how to add that so that it can combine. Thanks

akmalhafiz
Автор

Hi Jie, It was a great vdo. But Can you show us how to sort the PDF while merging. Eg: Lecture 1 should be on top, then Lecture 2 should go below that and so on

baalu
Автор

Hi, I am getting this error
PyPDF2.utils.PdfReadError: Could not find object.

gagikkarapetyan
Автор

merger.write( '') did not work at my end. I correct it tof = open('Complete.pdf', "wb"), it worked well.

adamyin
Автор

hi Jie ! Is it possible to merge pdfs using filedialog.askopenfiles instead of os.getcwd () ?

albertomatteoda
Автор

This is exactly how I've done my merge, so this validates I was doing it correctly. However, I have this issue: links that worked in each individual PDF are broken in the merged PDF. Any ideas???

Rosiepooh
Автор

Hi there...I was working on it but got this i got error...pls try to resolve this

shannu
Автор

i ran the code but getting error saying "ModuleNotFoundError: No module named 'pyPDF2'. i could see i have installed successfully

binukrishnan
Автор

Hi Jie, do you have the source code for the GUI app on your video?

OrlandoMarco
Автор

Is there any way I can get the files in order

yayatipalai
Автор

how to install this in my anaconda prompt? i get syntax error.

girimpr
welcome to shbcf.ru