forked from fraserxu/electron-pdf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
usage.txt
39 lines (36 loc) · 2.36 KB
/
usage.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
A command line tool to generate PDF from URL, HTML or Markdown files
Options
--help Show this help
--version Current version of package
-i | --input String - The path to the HTML file or url
-o | --output String - The path of the output PDF
-c | --css String - The path to custom CSS (can be specified more than once)
--acceptLanguage String - A valid value for the 'Accept-Language' http request header
--browserConfig String - A valid JSON String that will be parsed into the options passed to electron.BrowserWindow
-b | --printBackground Boolean - Whether to print CSS backgrounds.
true - default
-s | --printSelectionOnly Boolean - Whether to print selection only
false - default
-p | --pageSize String - Can be A3, A4, A5, Legal, Letter, Tabloid or an Object containing height and width in microns
"A4" - default
-l | --landscape Boolean - set this flag to print in landscape made, leave unset for portrait
-m | --marginsType Integer - Specify the type of margins to use
0 - default
1 - none (electron-pdf default setting)
2 - minimum
-d | --disableCache Boolean - Disable HTTP caching
false - default
-w | --outputWait Integer - Time to wait (in MS) between page load and PDF creation. If used in conjunction with -e this will override the default timeout of 10 seconds
-e | --waitForJSEvent String - The name of the event to wait before PDF creation
'view-ready' - default
-t | --trustRemoteContent Boolean - Trust remote content loaded in the Electron webview.
false - default
--type String - The type of export, will dictate the output file type. 'png': PNG image, anything else: PDF File
Usage
$ electron-pdf <input> <output>
$ electron-pdf <input> <output> -l
Examples
$ electron-pdf http://fraserxu.me ~/Desktop/fraserxu.pdf
$ electron-pdf ./index.html ~/Desktop/index.pdf
$ electron-pdf ./README.md ~/Desktop/README.pdf -l
$ electron-pdf ./README.md ~/Desktop/README.pdf -l -c my-awesome-css.css