Merge XDV document information in shipout order

This commit is contained in:
gloamxun committed 2026-11-25 19:28:12 +08:00
1 parent 6826efbeb1
commit dd695a8945
9 files changed
+251 -21

No files matched your search

+14 -11
View File
@@ -2784,23 +2784,26 @@ fn write_pdf(
objects[0] = catalog;
if let Some(level) = final_compression {
let device = pages[0].pdf.as_ref().expect("validated native PDF options");
let info = match unicode {
Some(options) => native_information_dictionary(crate::pdf_device::PdfInfo {
entries: remapped.as_ref().and_then(|resources| resources.info.as_deref())
.unwrap_or(options.info.entries),
date: options.info.date,
}),
Some(options) => {
let info = crate::pdf_device::PdfInfo {
entries: remapped.as_ref().and_then(|resources| resources.info.as_deref())
.unwrap_or(options.info.entries),
date: options.info.date,
};
if device.driver == crate::pdf_device::PdfDriver::Xdv {
crate::pdf_device::xdv_document::information_dictionary(info, diagnostics)?
} else {
native_information_dictionary(info)
}
}
None => metadata_object(metadata)
.map(String::into_bytes)
.unwrap_or_else(|| b"<< /Producer (texrra Route-D native) >>".to_vec()),
};
objects.push(info);
let options = &pages[0]
.pdf
.as_ref()
.expect("validated native PDF options")
.file;
return Ok(objects::serialize(&objects, Some(objects.len()), options, level.max(0).min(9) as u8));
return Ok(objects::serialize(&objects, Some(objects.len()), &device.file, level.max(0).min(9) as u8));
}
let info_ref = match metadata_object(metadata) {