Skip to content

Getting Started

bentopdf-sh is a CLI wrapper for BentoPDF’s WASM engines. All conversion work is done by BentoPDF’s LibreOffice WASM, MuPDF, and pandoc-wasm engines — bentopdf-sh packages them as a command-line tool.

  • Node.js 20+ — check with node --version
  • npm 9+ (comes with Node.js)

WASM engines are downloaded on first use and cached at ~/.cache/bentopdf/. An internet connection is required the first time each engine is used; after that it works fully offline.

Terminal window
npx bentopdf-sh to-pdf report.docx

No installation required. Slower on first run while npm fetches the package.

Convert a Word document to PDF:

Terminal window
bentopdf to-pdf report.docx

Output: report.pdf in the same directory as the input.

Convert multiple files at once:

Terminal window
bentopdf to-pdf slides.pptx notes.md screenshot.png

Each file is converted independently. Failures are reported at the end; successful conversions are not affected by other files failing.

Write to a specific file:

Terminal window
bentopdf to-pdf report.docx --output ~/Desktop/report.pdf

Write to a directory (multiple inputs):

Terminal window
bentopdf to-pdf *.docx --output ./pdfs/

bentopdf can also convert Markdown and HTML to Word or PowerPoint — a feature that goes beyond what BentoPDF offers in the browser.

Terminal window
bentopdf to-docx notes.md # outputs notes.docx
bentopdf to-pptx slides.md # outputs slides.pptx
bentopdf to-docx notes.md -t brand-template.docx # apply a reference doc

Use --template (-t) to apply a reference document for branded output. See CLI Reference for details.