In this recipe, we'll see how to mix two PDFs into the same one. This will allow us to combine reports into a bigger one.
Aggregating PDF reports
Getting ready
We'll use the PyPDF2 module. Pillow and pdf2image are also dependencies used by the scripts:
$ echo "PyPDF2==1.26.0" >> requirements.txt
$ echo "pdf2image==0.1.14" >> requirements.txt
$ echo "Pillow==5.1.0" >> requirements.txt
$ pip install -r requirements.txt
For pdf2image to properly work, it needs to install pdftoppm, so check here for instructions on how to install it for different platforms: https://github.com/Belval/pdf2image#first-you-need-pdftoppm.
We need two PDFs to combine them. For this recipe, we&apos...