summaryrefslogtreecommitdiff
path: root/crates/typst-pdf
diff options
context:
space:
mode:
authorPgBiel <9021226+PgBiel@users.noreply.github.com>2024-10-07 05:23:59 -0300
committerGitHub <noreply@github.com>2024-10-07 08:23:59 +0000
commit2a40eb518c737f4644099881a23295a650eb9ea1 (patch)
treedaa29e03387a3aa4662183edf1c8eadb6e5d966d /crates/typst-pdf
parent82a2c3619ad6884fc3a50baa787a6fdc288f13e7 (diff)
Fix excluded PDF pages being written (#5133)
Diffstat (limited to 'crates/typst-pdf')
-rw-r--r--crates/typst-pdf/src/page.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/typst-pdf/src/page.rs b/crates/typst-pdf/src/page.rs
index f112c81c..631eec11 100644
--- a/crates/typst-pdf/src/page.rs
+++ b/crates/typst-pdf/src/page.rs
@@ -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))
}