Merge pull request #60 from Farhan-2222/master

PNG to PDF converter
This commit is contained in:
Advaita Saha 2022-10-02 17:14:52 +05:30 committed by GitHub
commit b1fc5dd669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View 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