One PDF template, hundreds of copies
Seshat now makes a copy of a PDF template per row, such as certificates and grade lists from a spreadsheet, as one job with a report per copy. It finds placeholders that editors split into pieces, deletes text cleanly and tells where a text sits on the page.
Certificates, grade lists, name badges: one design, a different name and result on every copy. Seshat now makes all the copies in one job.
A copy per row
fillTemplate takes a PDF template with placeholders such as [name] and [grade], and a list of rows, one per copy: { "[name]": "Sara Ahmed", "[grade]": "A" }. The template is sent once. Each copy is the template with that row's texts set at the same place and size, in the template's own font.
The copies come back as a ZIP with one PDF per row, named after a placeholder if you like (Sara-Ahmed.pdf), or as one merged PDF to print in one go. Every 250 copies make one file, so even 5,000 certificates download in manageable parts.
A long list is a job: poll it to see how far it is, or have the result sent to your webhook. The Laravel and Node.js packages send the rows in steps and wait for the result with one call.
A report for every copy
Each copy says whether every placeholder was filled. A placeholder that is not in the template, or a letter the font does not have, shows up on that row, so a wrong copy is found before it is printed. A copy is charged only when something was filled in. The names and results in your rows are never kept for Rekhu's learning; only how the job went, such as which placeholders were missing, helps Seshat get better.
Placeholders split into pieces
Word and InDesign often store a placeholder like [name] as several pieces inside the PDF. Seshat now reads pieces that follow each other as one, so the placeholder is found whole. This applies to every text change, not only to templates.
Delete a text, find a text
An empty replacement removes a text from the page, with nothing drawn in its place. And textPositions answers where a text sits: the page, its box in points, the font and the size, to place your own layers next to it.