Fix excluded PDF pages being written (#5133)

This commit is contained in:
PgBiel 2024-10-07 05:23:59 -03:00 committed by Laurenz
parent af1de13942
commit 695d24baed

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 chunk
.pages(page_tree_ref) .pages(page_tree_ref)
.count(ctx.pages.len() as i32) .count(page_kids.clone().count() as i32)
.kids(ctx.globals.pages.iter().filter_map(Option::as_ref).copied()); .kids(page_kids);
Ok((chunk, page_tree_ref)) Ok((chunk, page_tree_ref))
} }