DWS CLI for the Nutrient Document Web Services (Processor API). This tool provides a local workflow for preflight checks, HTML‑to‑PDF conversion, benchmarking, reporting, and design skill packs.
Status: Early but functional. Preflight uses
/processor/preflight_html(which discards PDF output), and render profiles are sent via experimental headers (backend support required).
dws setup— store API key locallydws preflight— validate HTML inputs (calls preflight API, discards output)dws convert— convert HTML → PDF via APIdws benchmark— run real conversion benchmarks against the APIdws report— generate a markdown report from resultsdws skills— manage design skill packs
npm install -g @pspdfkit/dws-cliOr use without installing:
npx @pspdfkit/dws-cli --helpgit clone https://github.com/PSPDFKit-labs/dws-cli.git
cd dws-cli
npm install
npm run builddws --helpdws setup --api-key <key>dws preflight <htmlPath>dws convert <htmlPath> --output output.pdf --deterministic --profile-name deterministicdws benchmark --suite W1-W6 --out results.jsondws benchmark --suite W1-W6 --out results.json --artifacts-dir ./bench-artifactsdws report --in results.json --out report.mddws skills listdws skills add /path/to/skilldws skills add https://example.com/design-skill.jsondws skills validate /path/to/skill- API key can be supplied via
DWS_API_KEYor stored in~/.dws/config.jsonusingdws setup. - Override the API base URL with
DWS_API_BASE_URLif needed (defaults tohttps://api.nutrient.io). - Config file is written with
0600permissions.
A design skill pack is a folder containing a design-skill.json manifest, an entry HTML file, and assets (CSS/fonts/images).
Example manifest:
{
"name": "invoice-modern",
"version": "0.1.0",
"description": "Modern invoice template",
"entry": "index.html",
"assets": ["styles.css", "fonts/*"],
"defaults": {"locale": "en-US", "paper": "A4"}
}- Node 18+ recommended
npm run buildcompiles todist/
- Update README/CHANGELOG and version in
package.json npm run buildgit tag vX.Y.Zandgit push origin vX.Y.Z
MIT — see LICENSE