test(pdf): keep the offsets for the trailer

This commit is contained in:
Dylan M. Taylor
2026-11-03 23:29:32 +07:00
committed by bflatastic
parent bcc26d28a6
commit c3f1a17ad1
+1 -1
View File
@@ -146,7 +146,7 @@ fn raw_pdf_bytes(objects: impl IntoIterator<Item = Vec<u8>>) -> Vec<u8> {
}
let xref = out.len();
out.extend_from_slice(format!("xref\n0 {}\n0000000000 65535 f \n", offsets.len() + 1).as_bytes());
for at in offsets {
for at in &offsets {
out.extend_from_slice(format!("{at:010} 00000 n \n").as_bytes());
}
out.extend_from_slice(format!("trailer\n<< /Size {} /Root 1 0 R >>\nstartxref\n{xref}\n%%EOF\n", offsets.len() + 1).as_bytes());