Skip to content

Instantly share code, notes, and snippets.

@e96031413
Created Dec 29, 2019
Embed
What would you like to do?
Merge all your jpg files into a single PDF
import img2pdf
import os
current_path = os.getcwd()
with open("output.pdf", "wb") as f:
f.write(img2pdf.convert([i for i in os.listdir(current_path) if i.endswith(".jpg")]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment