implement tests for multipage pdf embedding
This commit is contained in:
17
tests/pdf_embedding.typ
Normal file
17
tests/pdf_embedding.typ
Normal 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
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
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
BIN
tests/pdf_embedding_03.pdf
(Stored with Git LFS)
Normal file
Binary file not shown.
Reference in New Issue
Block a user