Skip to content

Commit b8626f2

Browse files
Add HTML url to PDF converter
Signed-off-by: Sarthak Roy <sarthakroy2002@gmail.com>
1 parent d192769 commit b8626f2

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

scripts/HTML-To-PDF/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# HTML to PDF
2+
This is a simple script that lets you convert HTML url to pdf.
3+
4+
## Usage
5+
6+
* Clone the repo
7+
* download the requirements
8+
* Install [wkhtmltopdf](https://wkhtmltopdf.org/downloads.html) as per your operating system
9+
* run `python script.py`
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pdfkit==0.6.1

scripts/HTML-To-PDF/script.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import pdfkit
2+
url = input('Enter the URL of the HTML: ')
3+
pdf = input('Enter name of output pdf file without extension :')
4+
pdfkit.from_url(url, pdf + '.pdf')
5+
print("Done, The HTML url has been converted to PDF")

0 commit comments

Comments
 (0)