Sitemap
Geek Culture

A new tech publication by Start it up (https://medium.com/swlh).

Member-only story

How to automatically add pngs/jpgs to a pdf file

3 min readSep 8, 2021

--

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
Kevin Tomas

Written by Kevin Tomas

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!