Honor PDF draft mode in native execution and publication

This commit is contained in:
gloamxun committed 2026-11-27 22:48:48 +08:00
1 parent af19a26c23
commit f14669ae39
13 files changed
+206 -30

No files matched your search

@@ -1400,6 +1400,13 @@ impl State {
self.parameters.remove(&old);
}
pub(super) fn disable_draft_stream_compression(&mut self) {
// This is a device update to the current eqtb value. Existing save
// entries still restore the enclosing group's compression setting.
self.parameters
.insert(Parameter::Pdfcompresslevel, ParameterValue::Integer(0));
}
/// Explicit host selection of the PDF driver (INITEX itself defaults to
/// pdfoutput=0). The source can still assign the real parameter.
pub fn with_pdf_output(mut self) -> Self {
@@ -1746,6 +1753,11 @@ impl State {
pub fn is_initex(&self) -> bool {
self.initex
}
/// Whether this job has started PDF output in TeX's draft mode.
pub fn pdf_draft_mode(&self) -> bool {
self.pdf_header_options.is_some_and(|options| options.draft_mode)
}
/// Final PDF output uses the live state after the last page ships out.
pub fn pdf_final_options(&self) -> crate::pdf_unicode::PdfFinalOptions<'_> {
crate::pdf_unicode::PdfFinalOptions {