Fix excluded PDF pages being written (#5133)

This commit is contained in:
PgBiel 2024-10-07 05:23:59 -03:00 committed by GitHub
parent 82a2c3619a
commit 2a40eb518c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -106,10 +106,12 @@ pub fn write_page_tree(ctx: &WithRefs) -> SourceResult<(PdfChunk, Ref)> {
);
}
let page_kids = ctx.globals.pages.iter().filter_map(Option::as_ref).copied();
chunk
.pages(page_tree_ref)
.count(ctx.pages.len() as i32)
.kids(ctx.globals.pages.iter().filter_map(Option::as_ref).copied());
.count(page_kids.clone().count() as i32)
.kids(page_kids);
Ok((chunk, page_tree_ref))
}