Skip to content

PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust

cos: the /Prev repair note names the reference's own generation (#2366)

wstock801980ba352a
diff --git a/crates/cos/src/document.rs b/crates/cos/src/document.rs
index 7299056b2..b1c0e1648 100644
--- a/crates/cos/src/document.rs
+++ b/crates/cos/src/document.rs
@@ -2017,7 +2017,10 @@ fn prev_offset(data: &[u8], trailer: &Dict, off: u64, lookup: impl Fn(u32) -> Op
Some(p)
}
None => {
- log.push(format!("the trailer at {off} gives /Prev as the reference {} 0 R; reading it as offset {}", r.num, r.num));
+ log.push(format!(
+ "the trailer at {off} gives /Prev as the reference {} {} R; reading it as offset {}",
+ r.num, r.generation, r.num
+ ));
Some(u64::from(r.num))
}
}