Install the CLI, convert PDFs to Markdown or text on your computer, and add Vision OCR for scans, handwriting, and complex layouts.
Three steps
Start with local standard conversion. Add Vision for scans, handwriting, formulas, or complex layouts.
Install the package from npm, or use the shell installer in the guide.
Run pdf-to-markdown INPUT [OUTPUT]. Standard conversion works without an account.
Add --vision for scans, handwriting, formulas, and complex layouts. Use an API key, saved sign-in, or CLI license key.
Terminal example
Install the package once. Then choose standard conversion or Vision and search the extracted Markdown from the same terminal.
npm install -g @pspdfkit/pdf-to-markdownpdf-to-markdown input.pdf output.mdpdf-to-markdown --vision scan.pdf scan.mdquery text output.md "invoice total"Commands
pdf-to-markdown INPUT [OUTPUT] converts a PDF or directory to Markdown. pdf-to-text INPUT [OUTPUT] creates text. query text INPUT QUERY searches an extracted file and is free. Use nutrient auth login, status, and logout to manage sign-in.
Options
--vision improves extraction for scans, handwriting, and complex layouts. --provider auto|cpu|gpu selects Vision processing. --threads sets parallel file conversions. --api-key and --license-key provide credentials. In CI, set NUTRIENT_API_KEY instead of passing the key as an argument. --enable-image-export saves extracted images beside the Markdown output.
Who it’s for
Use the CLI from a terminal, a script, or CI. Agents can read its Markdown output. Use --threads to convert folders in parallel. Choose the PDF-to-Markdown API for application integration. See OCR PDFs in Linux for a related command-line workflow.
Next steps
Learn the CLI:
Choose another workflow:
Compare plans:
Standard conversion works without an account and can continue when Nutrient is unavailable. Vision requires an API key, saved sign-in, or CLI license key. After Vision connects, it can work offline for one hour and process up to 100 pages before reconnecting.
Yes. Add --vision to improve extraction for scans, handwriting, formulas, and complex layouts.
The CLI supports macOS 13 or newer on Apple Silicon, Linux with glibc 2.38 or newer, and Windows. Windows users run shell commands in Git Bash. Minimal Ubuntu 24.04 images also need libcurl4t64, libicu74, and ca-certificates.
No. The CLI creates Markdown or text. Use the PDF OCR API when you need a searchable PDF.
Standard conversion and the query command are free, and every plan includes Vision pages for scans and complex layouts. See PDF-to-Markdown pricing for Vision allowances.