Getting started
Installation
Get a trial key, install the brevier command with pip, Docker or a one-line script on Linux, macOS and Windows, then render your first PDF.
On this page
Requirements
- Python 3.10 or newer, for the pip install
- or Docker, if you do not want Python on your machine
Brevier prints with WeasyPrint. WeasyPrint needs the Pango text library. Most Linux systems and macOS with Homebrew have it already. If Pango is missing, Brevier stops with a message that says what to install.
Get a trial key
Every render needs a licence key, also for testing. Get the key before the first render.
- Request a free 30-day trial key on the pricing page. It arrives by email.
- Set the
BREVIER_LICENCE_KEYenvironment variable:
export BREVIER_LICENCE_KEY="<your-licence-key>"$env:BREVIER_LICENCE_KEY = "<your-licence-key>"After 30 days, you need a paid licence.
Install with pip
pip install brevierRun with Docker
docker pull brevier/brevier:latestInstall with a script
The script installers set up the same brevier command as pip.
curl -fsSL https://get.brevier.dev | bashirm https://get.brevier.dev/ps | iexRender your first PDF
Create document.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Getting started</title>
<style>
@page { size: A4; margin: 20mm; }
body { font-family: sans-serif; font-size: 11pt; line-height: 1.5; color: #111; }
h1 { font-size: 20pt; margin-bottom: 8mm; color: #0b3d91; }
p { margin-bottom: 4mm; }
</style>
</head>
<body>
<h1>Hello, Brevier!</h1>
<p>Rendered from the getting-started guide.</p>
</body>
</html>With pip or the script, render document.html to document.pdf:
brevier pdf document.html -o document.pdfWith Docker, mount the current folder to /work and pass
BREVIER_LICENCE_KEY to the container:
docker run --rm -v "$(pwd):/work" -e BREVIER_LICENCE_KEY="$BREVIER_LICENCE_KEY" brevier/brevier:latest pdf document.html -o document.pdfOn Fedora, RHEL and other systems with SELinux, write
"$(pwd):/work:Z" instead of "$(pwd):/work". Without :Z, the container
cannot write document.pdf into the folder.
Open document.pdf. The next page builds a real invoice.