How to automatically add pngs/jpgs to a pdf file

Use python in order to easily automate stuff which usually takes several minutes or even hours and save some valuable lifetime!

Kevin Tomas
Geek Culture

--

Recently a small company approached me and asked me to develop a tool which automatically inserts signatures in form of pngs/jpgs to pdf files. In some cases they have contracts consisting out of hundreds of single pages and on every of these pages they needed to insert a digital signature. But instead of manually adding this signature on every page, they wanted me to write a script which automatically adds this signatures in only a few seconds.

Watch the video below for a simple demonstration of the script I wrote:

Setup

For this project I used a library called PyMuPDF which among other things allows you to easily modify PDF files. Check out the documentation in order to get an overview of its functions.

Use pip install PyMuPDF to install the packages we will need for this purpose. And…

--

--

Kevin Tomas
Geek Culture

Hi there ✌🏽My name is Kevin and I'm a junior software developer from Hamburg! I'm interested in everything concerning Data Science and Web Development!