Restore PDF Forms from native formats
This commit is contained in:
1 parent
c2d3312e5a
commit
57a7097857
12 files changed
+300
-87
No files matched your search
@@ -243,7 +243,6 @@ pub struct Executor {
|
||||
pdf_outline_payload: usize,
|
||||
pdf_info_tokens: Vec<Token>,
|
||||
pdf_images: Vec<pdf_image::RegisteredImage>,
|
||||
pdf_forms: BTreeMap<u32, pdf_form::RegisteredForm>,
|
||||
restored_pdf_image_count: usize,
|
||||
format_image_warnings: Vec<String>,
|
||||
pdf_force_pagebox_warned: bool,
|
||||
@@ -423,7 +422,6 @@ impl Executor {
|
||||
pdf_outline_payload: 0,
|
||||
pdf_info_tokens: Vec::new(),
|
||||
pdf_images: Vec::new(),
|
||||
pdf_forms: BTreeMap::new(),
|
||||
restored_pdf_image_count: 0,
|
||||
format_image_warnings: Vec::new(),
|
||||
pdf_force_pagebox_warned: false,
|
||||
@@ -2389,7 +2387,7 @@ impl Executor {
|
||||
}
|
||||
Meaning::Primitive(Primitive::Pdflastxform) => {
|
||||
self.reads.insert(Dependency::PdfObjects);
|
||||
Ok(self.pdf_forms.last_key_value().map_or(0, |(&number, _)| number as i32))
|
||||
Ok(self.state.pdf_forms.last_key_value().map_or(0, |(&number, _)| number as i32))
|
||||
}
|
||||
Meaning::Primitive(Primitive::Pdflastobj) => {
|
||||
self.reads.insert(Dependency::PdfObjects);
|
||||
@@ -4052,9 +4050,6 @@ impl Executor {
|
||||
.fail("dump requires closed groups and conditionals");
|
||||
}
|
||||
self.ensure_format_pdf_images()?;
|
||||
if !self.pdf_forms.is_empty() {
|
||||
return self.fail("cannot dump a format with registered PDF Forms");
|
||||
}
|
||||
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