jubarte-render
The render product of the jubarte DOCX engine: it lays a Word document out page by page and writes a PDF, or one PNG per page. The layout engine is its own and aims at Microsoft Word's output; it does not call Word or LibreOffice. Tracked changes and comments are drawn in one of three styles: jubarte's conventional colours (the default), Word's, or a custom palette.
Where it sits
jubarte-dom → jubarte-opc → jubarte-redlines / jubarte-render →
jubarte-doc / jubarte-markdown / jubarte-edit → jubarte-cli → jubarte
jubarte-render sits on jubarte-dom and jubarte-opc, beside
jubarte-redlines. The document, Markdown and edit layers use it behind
their render features.
When to use this crate
Depend on jubarte-render when DOCX to PDF or PNG is what you need. It does
not compare documents and does not read Markdown: Markdown reaches PDF
through jubarte-markdown, which writes a DOCX first. For comparing and
rendering together, depend on the facade crate jubarte.
Install
or in Cargo.toml:
[]
= "0.20.0"
The jubarte crates are released together at one version and pin each other exactly, so depend on the same version of every jubarte crate you use. Minimum supported Rust version: 1.94.
Cargo features
None is on by default.
| Feature | What it adds |
|---|---|
perf-profile |
Forwards to jubarte-opc/perf-profile: stage counters and timers. Diagnostic only. |
test-support |
Hidden helpers for jubarte's own tests; not a public API. |
Example
use ;
Modules
convert: DOCX to PDF and PNG (docx_to_pdf,docx_to_pdf_with,docx_to_png,docx_to_pdf_report), the options (PdfOptions,RevisionStyle,CommentPlacement), page diffs (diff_render) and the font report.- Re-exported from the layers below:
opcandadmission(jubarte-opc);xmllinq,namespacesandutil(jubarte-dom).
Fonts
A run is drawn with the font the document embeds for it, else the installed
font of that name, else the substitutes Word would use, else a face bundled
in this crate that keeps the original's metrics (Carlito for Calibri,
Liberation Sans for Arial, Liberation Serif for Times New Roman, Liberation
Mono for Courier New). A substitute can change the layout, so install the
fonts your documents name for output closest to Word's. JUBARTE_FONT_DIR adds a font folder, and JUBARTE_FONT_INDEX moves
the persistent font index (off disables it).
The crate bundles 16 font programs under assets/fonts/: Carlito and the
Liberation Sans, Serif and Mono families, each in four styles. They keep
their own licence: both families are under the SIL Open Font License 1.1,
with their copyright notices in
LICENSE-Carlito and
LICENSE-Liberation, which ship in the
crate beside the fonts.
License
The code is Apache-2.0; the bundled fonts keep the licenses named above. NOTICE carries the attributions of the projects this code derives from.
Links
- API reference: docs.rs/jubarte-render
- Guide: jubarte-render on ReadTheDocs, part of the jubarte documentation
- Repository: github.com/jandira-tech/jubarte (this crate)
- Command line: the CLI reference of the root README
- Changes: CHANGELOG.md