Created
September 21, 2020 22:53
-
-
Save alrafiabdullah/559367e4dcfd0995ef1c30d8a1bfee7e to your computer and use it in GitHub Desktop.
Create PDF from Images (Except .png)
This file contains 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
import img2pdf # run pip install img2pdf | |
img = "" # Local image file location | |
f = open('output.pdf', 'wb') | |
f.write(img2pdf.convert(img)) # Writes pdf file in the root directory | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment