pub struct PdfExportOptions {Show 18 fields
pub page_width_mm: f32,
pub page_height_mm: f32,
pub margin_top_mm: f32,
pub margin_bottom_mm: f32,
pub margin_left_mm: f32,
pub margin_right_mm: f32,
pub font_family: String,
pub font_bytes: Vec<Vec<u8>>,
pub font_size_pt: f32,
pub line_spacing: f32,
pub first_line_indent_mm: Option<f32>,
pub paragraph_spacing_pt: Option<f32>,
pub justify: bool,
pub base_rtl: bool,
pub lang: Option<String>,
pub title: Option<String>,
pub author: Option<String>,
pub include_preamble: bool,
}Expand description
Page geometry + typography + embedded font bytes for a PDF export.
All lengths are in millimetres (matching Preset’s existing unit in callers such as
Skribisto’s compiler); they are converted to Typst’s cm/pt length literals at
markup-emission time, not here — this struct stays a plain, unit-tagged data record.
Fields§
§page_width_mm: f32Page width, in millimetres.
page_height_mm: f32Page height, in millimetres.
margin_top_mm: f32Top page margin, in millimetres.
margin_bottom_mm: f32Bottom page margin, in millimetres.
margin_left_mm: f32Left page margin, in millimetres.
margin_right_mm: f32Right page margin, in millimetres.
font_family: StringBody font family name, emitted as #set text(font: ..). Empty ⇒ the emitter omits the
font: argument entirely, letting Typst fall back to its own built-in default face.
font_bytes: Vec<Vec<u8>>Raw TTF/OTF font blobs, handed directly to the embedded Typst compiler’s .fonts(..).
At least one entry is required for document_io::typst_compile::compile_typst_pdf to
succeed; this struct itself does not enforce that (Default is an empty list).
font_size_pt: f32Body font size, in points.
line_spacing: f32Paragraph line spacing (Typst leading), in em. Typst’s own default is 0.65.
first_line_indent_mm: Option<f32>First-line paragraph indent, in millimetres. None ⇒ no first-line indent.
paragraph_spacing_pt: Option<f32>Extra space after each paragraph, in points. None ⇒ Typst’s own default spacing.
justify: boolJustify body paragraphs (document-level default; per-block alignment still overrides).
base_rtl: boolDocument-level base reading direction. Per-block RTL (fmt_direction) still wraps its
own content in a local #text(dir: ..) override regardless of this value.
lang: Option<String>Document-wide primary language, as an ISO 639-1 tag (e.g. "en", "fr"), emitted as
#set text(lang: ..). None ⇒ the emitter omits the lang: argument.
title: Option<String>PDF /Title metadata (via #set document(title: ..)). None ⇒ no title is emitted —
Typst/krilla’s own defaults apply (no explicit /Title).
PDF /Author metadata (via #set document(author: ..)). None ⇒ no author is emitted.
include_preamble: boolEmit the #set page/text/par/smartquote/heading preamble. Mirrors
ExportLatexDto.include_preamble — false produces a bare body, e.g. for embedding this
export’s markup inside a larger hand-authored Typst document.
Trait Implementations§
Source§impl Clone for PdfExportOptions
impl Clone for PdfExportOptions
Source§fn clone(&self) -> PdfExportOptions
fn clone(&self) -> PdfExportOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more