Execute positioned TeX specials through native PDF devices

This commit is contained in:
gloamxun committed 2026-11-21 11:24:46 +08:00
1 parent 05e633bb14
commit ce8a780031
21 files changed
+519 -29

No files matched your search

@@ -1,5 +1,5 @@
use super::*;
use crate::pdf_device::{PdfFileOptions, PdfPageData};
use crate::pdf_device::{PdfDriver, PdfFileOptions, PdfPageData};
impl Executor {
/// TeX extension commands share the scanner and produce their normal
/// effects in math as well as in vertical and horizontal lists.
@@ -26,6 +26,7 @@ impl Executor {
span: token.span,
})?;
}
Special => self.scan_special(token.span, files)?,
Pdfsave | Pdfsetmatrix | Pdfrestore | Pdfliteral => {
self.scan_pdf_graphics(primitive, token.span, files)?
}
@@ -259,7 +260,12 @@ impl Executor {
if level > 9 {
return self.fail("invalid native PDF compression level");
}
let driver = match self.state.input_profile() {
InputProfile::TeX8Bit => PdfDriver::PdfTeX,
InputProfile::UnicodeScalar => PdfDriver::Xdv,
};
Ok(Some(PdfPageData {
driver,
file: self.state.pdf_file_options.clone().unwrap(),
stream_compression: level.max(0) as u8,
}))