Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created March 27, 2018 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/eb91bd0c634a92309f590fc995897630 to your computer and use it in GitHub Desktop.
Save parzibyte/eb91bd0c634a92309f590fc995897630 to your computer and use it in GitHub Desktop.
import os
import img2pdf
imagenes_jpg = [archivo for archivo in os.listdir('./') if archivo.endswith(".jpg")]
with open("documento.pdf", "wb") as documento:
documento.write(img2pdf.convert(imagenes_jpg))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment