Save the pdf file via headless browser and Vivliostyle.
npm install @vivliostyle/cli![npm][npm-url]
![npm: total downloads][npm-url]
[npm-url]: https://npmjs.org/package/@vivliostyle/cli
```
npm install -g @vivliostyle/cli
See User Guide
`
Usage: vivliostyle [options] [command]
Options:
-v, --version output the version number
-h, --help display help for command
Commands:
create Scaffold a new Vivliostyle project
init Create a Vivliostyle configuration file
build Create PDF, EPUB, and other publication files
preview Open the preview page and interactively save PDFs
help [command] display help for command
`
> Scaffold a new Vivliostyle project
You are new to Vivliostyle? Check out our Create Book project.
With Create Book, you can easily bootstrap your book project and start writing without any extra effort.
Full CLI options
`
Usage: vivliostyle create [options] [projectPath]
scaffold a new Vivliostyle project
Options:
--title
or as a local directory to copy from.
--install-dependencies Install dependencies after creating a project.
--no-install-dependencies Do not install dependencies after creating a project.
--create-config-file-only Create a Vivliostyle config file without generating project template files.
--proxy-server HTTP/SOCK proxy server url
--proxy-bypass optional comma-separated domains to bypass proxy
--proxy-user optional username for HTTP proxy authentication
--proxy-pass optional password for HTTP proxy authentication
--log-level specify a log level of console outputs (choices: "silent", "info", "verbose", "debug", default: "info")
-v, --version output the version number
-h, --help display help for command
`$3
> Create a Vivliostyle configuration file
Full CLI options
`
Usage: vivliostyle init [options]create vivliostyle config file
Options:
--title
title
--author author
-l, --language language
-s, --size paper size
-T, --theme theme
--log-level specify a log level of console outputs (choices: "silent", "info", "verbose", "debug", default: "info")
-v, --version output the version number
-h, --help display help for command
`$3
> Create PDF, EPUB, and other publication files
Full CLI options
`
Usage: vivliostyle build [options] [input]build and create PDF file
Options:
-c, --config path to vivliostyle.config.js [vivliostyle.config.js]
-o, --output specify output file name or directory [.pdf]
This option can be specified multiple, then each -o options can be supplied one -f option.
ex: -o output1 -f webpub -o output2.pdf -f pdf
-f, --format specify output format corresponding output target
If an extension is specified on -o option, this field will be inferenced automatically.
-s, --size output pdf size
preset: A5, A4, A3, B5, B4, JIS-B5, JIS-B4, letter, legal, ledger
custom(comma separated): 182mm,257mm or 8.5in,11in
-m, --crop-marks print crop marks
--bleed extent of the bleed area for printing with crop marks [3mm]
--crop-offset distance between the edge of the trim size and the edge of the media size. [auto (13mm + bleed)]
--css custom style CSS code. (ex: ":root {--my-color: lime;}")
--style Additional stylesheet for Vivliostyle viewer.
--user-style Additional user stylesheet for Vivliostyle viewer.
-d, --single-doc single HTML document input
-p, --press-ready make generated PDF compatible with press ready PDF/X-1a [false]
This option is equivalent with "--preflight press-ready"
-t, --timeout timeout limit for waiting Vivliostyle process [300]
-T, --theme theme path or package name
--title title
--author author
-l, --language language
--reading-progression Direction of reading progression (choices: "ltr", "rtl")
--render-mode if docker is set, Vivliostyle try to render PDF on Docker container [local] (choices: "local", "docker")
--preflight apply the process to generate PDF for printing (choices: "press-ready", "press-ready-local")
--preflight-option options for preflight process (ex: gray-scale, enforce-outline)
Please refer the document of press-ready for further information.
https://github.com/vibranthq/press-ready
--executable-browser specify a path of executable browser you installed
--image specify a docker image to render
--viewer specify a URL of displaying viewer instead of vivliostyle-cli's one
It is useful that using own viewer that has staging features. (ex: https://vivliostyle.vercel.app/)
--viewer-param specify viewer parameters. (ex: "allowScripts=false&pixelRatio=16")
--browser Specify a browser type and version to launch the Vivliostyle viewer (ex: chrome@129, firefox) [chrome]
--proxy-server HTTP/SOCK proxy server url for underlying Playwright
--proxy-bypass optional comma-separated domains to bypass proxy
--proxy-user optional username for HTTP proxy authentication
--proxy-pass optional password for HTTP proxy authentication
--log-level specify a log level of console outputs (choices: "silent", "info", "verbose", "debug", default: "info")
--ignore-https-errors true to ignore HTTPS errors when Playwright browser opens a new page
--host IP address the server should listen on
--port port the server should listen on
--no-enable-static-serve disable static file serving
--vite-config-file Vite config file path
--no-vite-config-file ignore Vite config file even if it exists
-v, --version output the version number
-h, --help display help for command
`$3
> Open the preview page and interactively save PDFs
Full CLI options
`
Usage: vivliostyle preview [options] [input]launch preview server
Options:
-c, --config path to vivliostyle.config.js
-T, --theme theme path or package name
-s, --size output pdf size
preset: A5, A4, A3, B5, B4, JIS-B5, JIS-B4, letter, legal, ledger
custom(comma separated): 182mm,257mm or 8.5in,11in
-m, --crop-marks print crop marks
--bleed extent of the bleed area for printing with crop marks [3mm]
--crop-offset distance between the edge of the trim size and the edge of the media size. [auto (13mm + bleed)]
--css custom style CSS code. (ex: ":root {--my-color: lime;}")
--style Additional stylesheet for Vivliostyle viewer.
--user-style Additional user stylesheet for Vivliostyle viewer.
-d, --single-doc single HTML document input
-q, --quick quick loading with rough page count
--title title
--author author
-l, --language language
--reading-progression Direction of reading progression (choices: "ltr", "rtl")
--executable-browser specify a path of executable browser you installed
--viewer specify a URL of displaying viewer instead of vivliostyle-cli's one
It is useful that using own viewer that has staging features. (ex: https://vivliostyle.vercel.app/)
--viewer-param specify viewer parameters. (ex: "allowScripts=false&pixelRatio=16")
--browser Specify a browser type and version to launch the Vivliostyle viewer (ex: chrome@129, firefox) [chrome]
--proxy-server HTTP/SOCK proxy server url for underlying Playwright
--proxy-bypass optional comma-separated domains to bypass proxy
--proxy-user optional username for HTTP proxy authentication
--proxy-pass optional password for HTTP proxy authentication
--log-level specify a log level of console outputs (choices: "silent", "info", "verbose", "debug", default: "info")
--ignore-https-errors true to ignore HTTPS errors when Playwright browser opens a new page
--host IP address the server should listen on
--port port the server should listen on
--no-open-viewer do not open viewer
--no-enable-static-serve disable static file serving
--no-enable-viewer-start-page disable viewer start page
--vite-config-file Vite config file path
--no-vite-config-file ignore Vite config file even if it exists
-v, --version output the version number
-h, --help display help for command
``See Contribution Guide.
Licensed under AGPL Version 3.