Created
November 9, 2016 23:49
-
-
Save MonsieurV/58c94e687ae5ccf9ee5212671e0a85bc to your computer and use it in GitHub Desktop.
PyFPDF -- Images concatenation in PDF file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code from http://stackoverflow.com/a/27327984/1956471 | |
from fpdf import FPDF | |
pdf = FPDF('P', 'mm', 'A4') | |
for image in ['file1.jpg', 'file2.jpg', 'file3.jpg', 'file4.jpg', 'file5.jpg']: | |
pdf.add_page() | |
# Take full page. | |
# Doc. https://pyfpdf.readthedocs.io/en/latest/reference/image/index.html | |
pdf.image(image, 0, 5, 210) | |
pdf.output("output.pdf", "F") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment