Hello! I have an application that can generate a PDF from data that the user inputs. There are some scenarios where the data inputted can result in very large docs (19,000 pages as one of the extremes). Does anyone actually look at that; probably not, but they need it for their records…
I’ve noticed when I upgraded to 0.13.1 and started using context
in my header and footer when I set the page that I take a performance hit on these large documents. I’ve tested the following scenarios:
Header and Footer Set - 1 hour 9 min compile time
#set page(
paper: "us-letter",
margin: (
x: 1.25cm,
top: 2.75cm,
bottom: 2cm,
),
header: context {
if counter(page).get().first() > 1 [
Hello
]
},
footer: context {
if counter(page).get().first() > 1 [
#align(center, counter(page).display(("1")))
]
}
)
Header Only Set - 30 min compile time
#set page(
paper: "us-letter",
margin: (
x: 1.25cm,
top: 2.75cm,
bottom: 2cm,
),
header: context {
if counter(page).get().first() > 1 [
Hello
]
}
)
Footer Only Set - 29 min compile time
#set page(
paper: "us-letter",
margin: (
x: 1.25cm,
top: 2.75cm,
bottom: 2cm,
),
footer: context {
if counter(page).get().first() > 1 [
#align(center, counter(page).display(("1")))
]
}
)
No Header / No Footer - 5 min compile time
#set page(
paper: "us-letter",
margin: (
x: 1.25cm,
top: 2.75cm,
bottom: 2cm,
),
)
No Header / No Footer / Set Page Number - 16 min compile time
#set page(
paper: "us-letter",
margin: (
x: 1.25cm,
top: 2.75cm,
bottom: 2cm,
),
)
// table of contents
#set page(numbering: "1")
#show outline: set text(var_paragraph_text_size)
#show outline.entry.where(
level: 1
): it => {
v(12pt, weak: true)
strong(it)
}
#set heading(numbering: "1.")
#outline(
indent: auto
)
#pagebreak()
I’m totally OK if this is the way it is since these docs are huge, but I figured I’d ask if there are any work arounds I could try where I could still have a header and footer but go about it a different way? I programmatically build out the typst file from the data inputted, so I have flexibility in how I can construct it.
Thanks!