{pdf} turns HTML into a PDF on the server with a writer in plain PHP
(tags/_lib/pdf.php): PDF 1.4, the standard fonts every reader has, no library and no
headless browser. A pair renders its content as ever - fields, loops, tags - and the
response becomes the PDF of it (application/pdf, with the file name) instead of
the page; the page cache and tidy are left out. Written as a single tag,
{pdf download}, the whole page is the document. Several {pdf} pairs
on one page make one document, the first one's options counting.
h1-h6, p, b/strong,
i/em, u, code, a (a link of the
document for an http, https or mailto address), br, ul/ol/li
(nested), blockquote, pre, hr, tables with
colspan and align - the header row repeated on every page - and
img: a JPEG of www/<application>/ or a data:
address. Another picture is its alt text, any other element its text, and script, style, svg
and form fields are left out. The text is WinAnsi (a ? for what it lacks) and is
measured with the real font widths, so lines wrap where a reader draws them; past one page
there is "2 / 5" at the foot. The document carries no date, so the same page is the same
bytes.
With preview the page stays a page: the content is shown on a sheet with links
"Open name.pdf" and "Download", and the same address with &padPdf answers
the document. Only the page the request asked for answers a PDF: a {pdf} inside
a page included by {page} shows its content on its sheet, and the
response stays the including page's.
An unknown size or font is an error under the strict check. From
PHP, padPdf ( $html, [ 'size' => 'Letter' ] ) answers the bytes - for a
mail attachment, say.