mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-27 14:01:12 +00:00
commit
b1fc5dd669
9
scripts/PNG_To_PDF/README.md
Normal file
9
scripts/PNG_To_PDF/README.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
This script consist of python code which converts PNG to PDF.
|
||||
|
||||
It has a PNG image to use as example. For different image just write url of different image which you want to use/ replace "image.png" with total url of the image file.
|
||||
|
||||
Write the location of the PDF to be saved at/ replace 'document.pdf' with the total url and name of pdf along with pdf extension.
|
||||
|
||||
I have used flake8 linting on this as well.
|
||||
|
||||
Dependency: Download python and write "pip install Pillow" in cmd.
|
BIN
scripts/PNG_To_PDF/img.png
Normal file
BIN
scripts/PNG_To_PDF/img.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
5
scripts/PNG_To_PDF/png-to-pdf.py
Normal file
5
scripts/PNG_To_PDF/png-to-pdf.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from PIL import Image
|
||||
|
||||
image1 = Image.open(r'png-to-pdf.png')
|
||||
impdf = image1.convert('RGB')
|
||||
impdf.save(r'png-to-pdf.pdf') # noqa
|
Loading…
Reference in New Issue
Block a user