mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-27 14:01:12 +00:00
Merge pull request #43 from sarthakroy2002/html-pdf
Add HTML url to PDF converter
This commit is contained in:
commit
e43a912aa0
9
scripts/HTML-To-PDF/README.md
Normal file
9
scripts/HTML-To-PDF/README.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
# HTML to PDF
|
||||
This is a simple script that lets you convert HTML url to pdf.
|
||||
|
||||
## Usage
|
||||
|
||||
* Clone the repo
|
||||
* download the requirements
|
||||
* Install [wkhtmltopdf](https://wkhtmltopdf.org/downloads.html) as per your operating system
|
||||
* run `python script.py`
|
1
scripts/HTML-To-PDF/requirements.txt
Normal file
1
scripts/HTML-To-PDF/requirements.txt
Normal file
|
@ -0,0 +1 @@
|
|||
pdfkit==0.6.1
|
5
scripts/HTML-To-PDF/script.py
Normal file
5
scripts/HTML-To-PDF/script.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pdfkit
|
||||
url = input('Enter the URL of the HTML: ')
|
||||
pdf = input('Enter name of output pdf file without extension :')
|
||||
pdfkit.from_url(url, pdf + '.pdf')
|
||||
print("Done, The HTML url has been converted to PDF")
|
Loading…
Reference in New Issue
Block a user