briefutil is a small utility for turning short letters into PDF files. It
ships as both a Qt Quick desktop app and a CLI.
Letter layout, markdown body parsing, and PDF rendering are handled natively in C++ with Qt 6 and mark2haru.
The letter above produces a PDF like this:
- lets you pick a sender profile from JSON files
- collects recipient, subject, and body text in a small desktop UI
- provides
briefutil_clifor scriptable PDF generation - supports Markdown in the letter body (asterisk and underscore variants)
- generates DIN 5008 form A/B and US Letter PDFs
- ships bundled TrueType fonts and can use explicit
.ttffont files (TrueType rendering preserves non-CP1252 scripts) - localizable closing line, page-number footer, and error messages
(English by default, German auto-selected when the system locale is
de_*)
- CMake 3.24 or newer
- a C++20 compiler
- Qt 6 with:
CoreGuiQmlQuickQuickControls2QuickDialogs2
- network access on first configure if a sibling
mark2harucheckout is not available, because CMake fetchesmark2haru
From the repository root:
cmake -S briefutil -B briefutil/build -DCMAKE_PREFIX_PATH="C:/Qt/6.x/<toolchain>"
cmake --build briefutil/build --config ReleaseAdjust CMAKE_PREFIX_PATH to your local Qt installation, for example
msvc2022_64 or llvm-mingw_64.
With multi-config generators such as Visual Studio, the main executable will be built as:
briefutil/build/app/Release/briefutil.exe
briefutil/build/cli/Release/briefutil_cli.exe
To build only the core, CLI, and tests without the Qt Quick app:
cmake -S briefutil -B briefutil/build-cli -DCMAKE_PREFIX_PATH="C:/Qt/6.x/<toolchain>" -DBRIEFUTIL_BUILD_GUI=OFF
cmake --build briefutil/build-cli --config Release --target briefutil_cliAfter building:
briefutil/build/app/Release/briefutil.exeCLI example:
briefutil/build/cli/Release/briefutil_cli.exe `
--to "Ioannis Makris\nAm Zirkus 3\n10117 Berlin" `
--subject "Example letter" `
--body-file body.md `
--output example.pdfCommon CLI options:
--to TEXT,--to-file PATH, or stdin for the recipient block--subject TEXT--body TEXTor--body-file PATH--profile IDor--profile-path PATH--template-dir PATH--output PATHor--output-dir PATH--layout NAME(din_5008_form_b,din_5008_form_a, orus_letter)--font-sans VALUE,--font-sans-bold VALUE,--font-sans-italic VALUE,--font-sans-bold-italic VALUE,--font-mono VALUEfor explicit.ttffont paths--body-size PT(6..24),--body-leading PT(6..36)--header-scale PCT,--body-scale PCT,--footer-scale PCT(50..200)--forceto replace an existing--outputfile
On Windows, the CMake build also runs Qt deployment steps so the build output contains the required Qt DLLs, plugins, and QML modules.
build_portable.bat assembles a cleaner distributable layout under dist/portable/:
dist/portable/
briefutil.exe
briefutil_cli.bat
briefutil_runtime/
The visible top-level briefutil.exe is a launcher. The real Qt application
binary plus all DLLs, plugins, and QML files live in briefutil_runtime/.
briefutil_cli.bat starts the CLI from the same runtime directory.
On first launch, the app creates and seeds:
Windows: %APPDATA%/briefutil/templates/
Linux: $XDG_DATA_HOME/briefutil/templates/ (or ~/.local/share/briefutil/templates/)
macOS: ~/Library/Application Support/briefutil/templates/
This folder contains default sender profiles such as:
Max Mustermann.jsonMax Mustermann, Mustermann AG.jsonmustermann_signature.png
Generated PDFs are written by default to:
%USERPROFILE%/briefutil/output/
The template and output locations can also be overridden for one process:
$env:BRIEFUTIL_TEMPLATE_DIR = "C:/work/briefutil/templates"
$env:BRIEFUTIL_OUTPUT_DIR = "C:/work/briefutil/output"The app also stores UI and typography settings with QSettings, including:
- dark mode
- selected template directory
- font configuration
- body size and leading
An optional output_dir.conf file can override the default output directory.
For the portable package, place it next to the visible top-level briefutil.exe.
Sender profiles are JSON files loaded from the active template directory.
The important fields are:
idstylesender_linesemailreturn_address_linesigner_namesignature_image
Commercial profiles can additionally define:
company_namecompany_name_colortop_rule_colorfooter_linessigner_title
The signature_image path is interpreted relative to the profile directory.
The body field supports Markdown. The implemented subset includes:
- paragraphs
- bold
- italic
- headings
- bullet lists
- ordered lists
- images
- tables
Plain text without Markdown syntax also works.
The settings window allows changing the fonts used for PDF generation.
Leave fields empty to use the bundled default fonts. Non-empty fields must be
installed TrueType font names resolved by the desktop app, or explicit .ttf
file paths. The CLI accepts explicit .ttf paths.
The font configuration covers:
- sans regular
- sans bold
- sans italic
- sans bold italic
- monospace
The CMake project also defines a few development-only test executables:
test_renderertest_letter_buildertest_brief_servicetest_clitest_md_to_pdftest_path_utilstest_template_storetest_unicode_output_path
Typical examples:
briefutil/build/tests/Release/test_letter_builder.exe briefutil/build/tests/Release/sample.pdf
briefutil/build/tests/Release/test_md_to_pdf.exe briefutil/tests/data/test_sample.md briefutil/build/tests/Release/md.pdfThis project follows the Varinomics coding style guideline. The canonical guideline is maintained in the varinomics-standards repository. More information about Varinomics is available at varinomics.com.
Install:
cmake --install briefutil/build --config Release --prefix C:/apps/briefutilPackage:
cpack -C Release --config briefutil/build/CPackConfig.cmakeThe Windows packaging path is NSIS-based.
Source code is provided under the Simplified BSD License. See
LICENSE.txt.

