Struct tectonic::XdvipdfmxEngine
source · pub struct XdvipdfmxEngine { /* private fields */ }
Expand description
A struct for invoking the xdvipdfmx
engine.
This struct has a fairly straightforward “builder” interface: you create it,
apply any settings that you wish, and eventually run the
process()
method.
Due to constraints of the gnarly C/C++ code underlying the engine
implementation, only one engine may run at once in one process. The engine
execution framework uses a global mutex to ensure that this is the case.
This restriction applies not only to the XdvipdfmxEngine
type but to
all Tectonic engines. I.e., you can’t run this engine and the XeTeX engine
at the same time.
Implementations§
source§impl XdvipdfmxEngine
impl XdvipdfmxEngine
sourcepub fn enable_compression(
&mut self,
enable_compression: bool
) -> &mut XdvipdfmxEngine
pub fn enable_compression( &mut self, enable_compression: bool ) -> &mut XdvipdfmxEngine
Set whether compression will be enabled in the output PDF.
The default value is true. You might want to set this to false to
improve the reproducibility of your generated PDFs, since different
environments may create different compressed outputs even if their
inputs and algorithms are the same. If this is your interest,
see also enable_deterministic_tags
.
Set whether font tags will be generated deterministically.
The default is false: the engine includes some random characters when creating font tags. Changing this to true helps create byte-for-byte reproducible PDF outputs.
sourcepub fn build_date(&mut self, date: SystemTime) -> &mut XdvipdfmxEngine
pub fn build_date(&mut self, date: SystemTime) -> &mut XdvipdfmxEngine
Sets the build date embedded in the output artifacts
The default value is the Unix epoch, which is almost certainly not what you want. This value is used as a source of entropy and is written to the output PDF.
sourcepub fn paper_spec(&mut self, paper_spec: String) -> &mut XdvipdfmxEngine
pub fn paper_spec(&mut self, paper_spec: String) -> &mut XdvipdfmxEngine
Set the initial paper size specification to be used.
The default is "letter"
, regardless of current locale.
sourcepub fn process(
&mut self,
launcher: &mut CoreBridgeLauncher<'_>,
dvi: &str,
pdf: &str
) -> Result<(), Error>
pub fn process( &mut self, launcher: &mut CoreBridgeLauncher<'_>, dvi: &str, pdf: &str ) -> Result<(), Error>
Run xdvipdfmx.
The launcher parameter gives overarching environmental context in which the engine will be run.
The dvi parameter gives the name of the DVI file, created by the TeX engine, that will be processed. In Tectonic this is actually an XDV file, containing extended features needed for XeTeX Unicode processing.
The pdf parameter gives the name of the output PDF file to create.