implement tests for multipage pdf embedding

This commit is contained in:
2025-11-17 13:50:23 +01:00
parent ab0c992dc0
commit a4643419ef
4 changed files with 26 additions and 0 deletions

17
tests/pdf_embedding.typ Normal file
View File

@@ -0,0 +1,17 @@
#import "../template/pdf.typ": number_of_pages, embed_full
#let pdfinfo(src, target_pagecount) = {
let pdf = read(src, encoding: none);
let pagecount = number_of_pages(pdf);
[
= #src
Pagecount: #pagecount
];
place(bottom + right, [Starting on next page]);
assert(pagecount == target_pagecount);
embed_full(pdf);
}
#pdfinfo("./pdf_embedding_01.pdf", 1)
#pdfinfo("./pdf_embedding_02.pdf", 2)
#pdfinfo("./pdf_embedding_03.pdf", 1)

BIN
tests/pdf_embedding_01.pdf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
tests/pdf_embedding_02.pdf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
tests/pdf_embedding_03.pdf (Stored with Git LFS) Normal file

Binary file not shown.