File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Webpage to pdf
2
+ - - - - - -
3
+ ## Aim
4
+ Aim of the script is to convert a webpage to pdfcrowd
5
+
6
+ ## Requirements
7
+ ``` pip install pdfcrowd ```
8
+
9
+ ## Authentication
10
+
11
+ - Go to ``` https://pdfcrowd.com/ ```
12
+ - Login/signup with your email id and username
13
+ - Goto Account > Change API KEY
14
+ - You can either chose to change the key or use the one given
15
+
16
+ ## To Run
17
+ - ``` python convert.py ```
18
+ - Enter your username and KEY
19
+ - Webpage will be converted to pdf
Original file line number Diff line number Diff line change
1
+ import pdfcrowd
2
+ import sys
3
+
4
+ ## ask input URL from user
5
+ URL = input ("Please enter the URL of webpage you'd like to convert : " )
6
+ User = input ("Please enter your pdfcrowd API username " )
7
+ KEY = input ("Please enter your API key " )
8
+ try :
9
+ # Authenticate API and write result to pdf file in current directory
10
+ pdfcrowd .HtmlToPdfClient (User , KEY ).convertUrlToFile (URL , 'new.pdf' )
11
+
12
+ except pdfcrowd .Error as why :
13
+ # report the error
14
+ sys .stderr .write ('Pdfcrowd Error: {}\n ' .format (why ))
15
+ # rethrow or handle the exception
16
+ raise
You can’t perform that action at this time.
0 commit comments