feat(report): new cover and layout for the HTML and PDF reports
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
13f380291f
commit
fdf1e20cfb
10 files changed
+834
-208
No files matched your search
@@ -88,6 +88,12 @@ fn streams(pdf: &[u8]) -> Vec<String> {
|
||||
while let Some(s) = find(pdf, b">>\nstream\n", at) {
|
||||
let start = s + 10;
|
||||
let end = find(pdf, b"\nendstream", start).unwrap();
|
||||
// the cover logo is a raw JPEG (`/DCTDecode`), not a content stream
|
||||
let dict_start = pdf[..s].windows(2).rposition(|w| w == b"<<").unwrap();
|
||||
if find(&pdf[..s], b"/DCTDecode", dict_start).is_some() {
|
||||
at = end;
|
||||
continue;
|
||||
}
|
||||
let mut text = String::new();
|
||||
flate2::read::ZlibDecoder::new(&pdf[start..end])
|
||||
.read_to_string(&mut text)
|
||||
@@ -146,7 +152,11 @@ fn long_lists_paginate_with_numbered_footers() {
|
||||
assert!(pages.len() >= 5, "{} páginas", pages.len());
|
||||
let last = pages.len();
|
||||
assert!(pages[last - 1].contains(&format!("p\\341gina {last} de {last}")));
|
||||
assert!(pages[0].contains(&format!("p\\341gina 1 de {last}")));
|
||||
// page 1 is the full-bleed cover (no footer); numbering continues on page 2
|
||||
assert!(!pages[0].contains("p\\341gina 1 de"));
|
||||
assert!(pages[1].contains(&format!("p\\341gina 2 de {last}")));
|
||||
assert!(pages[0].contains("/Im1 Do"), "logo da capa ausente");
|
||||
assert!(pages[1].contains("TLP:AMBER"));
|
||||
// the table header row is repeated at the top of each continuation page
|
||||
assert!(pages[2].contains("Modificado \\(UTC\\)"));
|
||||
// every table row appears exactly once across all pages
|
||||
|
||||
Reference in new issue
Block a user