Restore registered pdfTeX images from native formats
This commit is contained in:
1 parent
1307bbcf0c
commit
c2f18f50dc
14 files changed
+667
-49
No files matched your search
@@ -242,6 +242,8 @@ pub struct Executor {
|
||||
pdf_outline_payload: usize,
|
||||
pdf_info_tokens: Vec<Token>,
|
||||
pdf_images: Vec<pdf_image::RegisteredImage>,
|
||||
restored_pdf_image_count: usize,
|
||||
format_image_warnings: Vec<String>,
|
||||
pdf_force_pagebox_warned: bool,
|
||||
input_position: Option<(usize, usize)>,
|
||||
paragraph: Option<super::paragraph::Builder>,
|
||||
@@ -419,6 +421,8 @@ impl Executor {
|
||||
pdf_outline_payload: 0,
|
||||
pdf_info_tokens: Vec::new(),
|
||||
pdf_images: Vec::new(),
|
||||
restored_pdf_image_count: 0,
|
||||
format_image_warnings: Vec::new(),
|
||||
pdf_force_pagebox_warned: false,
|
||||
input_position: None,
|
||||
paragraph: None,
|
||||
@@ -3170,8 +3174,10 @@ impl Executor {
|
||||
self.output_node(node, files)?;
|
||||
}
|
||||
self.collect_meaning_reads();
|
||||
let format_pdf_images = self.captured_format_pdf_images();
|
||||
Ok(Execution {
|
||||
format_dumped: self.format_dumped,
|
||||
format_pdf_images,
|
||||
job_name: self.job_name,
|
||||
interaction_mode: self.interaction_mode,
|
||||
native_page: self.native_page,
|
||||
@@ -3623,8 +3629,10 @@ impl Executor {
|
||||
let outgoing_state = previous
|
||||
.filter(|last| last.state == self.state)
|
||||
.map_or_else(|| self.state.fingerprint(), |last| last.outgoing_state);
|
||||
let format_pdf_images = self.captured_format_pdf_images();
|
||||
Ok(Execution {
|
||||
format_dumped: self.format_dumped,
|
||||
format_pdf_images,
|
||||
job_name: self.job_name,
|
||||
interaction_mode: self.interaction_mode,
|
||||
after_assignment: self.after_assignment,
|
||||
@@ -3653,6 +3661,7 @@ impl Executor {
|
||||
self.check_cancellation()?;
|
||||
self.change_interaction_mode(self.interaction_mode, files)?;
|
||||
let result = self.prepare_input(file, files).and_then(|initial_depth| {
|
||||
self.emit_format_image_warnings(files)?;
|
||||
self.run_active_input(initial_depth, files, capture_boundary)
|
||||
});
|
||||
self.finish_observed_input(result, files)
|
||||
@@ -4031,10 +4040,7 @@ impl Executor {
|
||||
return self
|
||||
.fail("dump requires closed groups and conditionals");
|
||||
}
|
||||
if !self.pdf_images.is_empty() {
|
||||
return self
|
||||
.fail("PDF image objects require a job-local PDF device");
|
||||
}
|
||||
self.ensure_format_pdf_images()?;
|
||||
self.reads.insert(Dependency::FontResources);
|
||||
if self.state.fonts.fonts().iter().any(|font| font.opentype().is_some()) {
|
||||
return self.fail("cannot dump a format with native OpenType fonts");
|
||||
|
||||
Reference in new issue
Block a user