Command-line getting started

Turn a document into PDF
from one command

Use the Rust renderer from a shell, CI job, build script, or local automation without writing integration code.

Native binary · HTML and Markdown

Install the binary

Install the current release from crates.io with a Rust toolchain:

cargo install ironpress

Confirm the executable is available:

ironpress --version

Convert an HTML file

Create invoice.html, then provide the input and output paths:

ironpress invoice.html invoice.pdf

The command writes invoice.pdf and reports the completed path on standard error.

Pipe HTML from another command

printf '<h1>Hello</h1>' | ironpress --stdin output.pdf

Convert Markdown

Files ending in .md or .markdown are detected automatically:

ironpress release-notes.md release-notes.pdf

Standard input is treated as HTML. Use a temporary .md file when your pipeline starts with Markdown.

Set page and output options

Compose flags to apply one document policy:

ironpress report.html report.pdf \
  --page-size letter \
  --landscape \
  --margin 36 \
  --header "Quarterly report" \
  --footer "Page {page} of {pages}"

Named sizes are a4, letter, and legal. Margins and page geometry use PDF points. Run ironpress --help for image quality, compression, sanitization, and raster controls.

Resolve local images, CSS, and fonts

Grant a base directory before a document can resolve relative URLs:

ironpress templates/invoice.html invoice.pdf \
  --base-path templates

Relative <img>, CSS @import, and @font-face URLs resolve below that canonical directory. Traversal and symlink escapes are rejected.

Understand CLI behavior

  • The CLI writes one complete output file per invocation.
  • HTML sanitization is enabled unless explicitly disabled.
  • The published binary does not fetch remote document resources.
  • JavaScript and browser DOM execution are outside the renderer's scope.

Invalid flags, unreadable input, conversion failures, and output errors print a diagnostic and return a nonzero exit status.

Go further

Move to a language binding when your application needs PDF bytes in memory or a reusable converter instance.