🖼️Template & Styling
Main content
The heart of the PDF content, isn't it? For this, you need to send a whole HTML document.
Recommended:
Remote paths for images, fonts (e.g., Google Fonts), etc., work too.
TailwindCSS also works great, give it a go 😎.
Header & Footer
If you want to use footer or header or both, you need to send a whole HTML document, e.g.:
The following classes allow you to inject printing values:
date
- formatted print date.title
- document title.url
- document location.pageNumber
- current page number.totalPages
- total pages in the document.
Limitation
No JavaScript.
The CSS properties are independent of the ones from the HTML document.
Also simple CSS only.
footer.html
CSS properties override the ones fromheader.html
.Images only work using a base64 encoded source - i.e.,
data:image/png;base64, iVBORw0K...
.background-color
andcolor
CSS properties require an additional-webkit-print-color-adjust: exact
CSS property to work.Assets are not loaded (i.e., CSS files, scripts, fonts, etc.).
For fonts, check out the section below.
Background form fields do not apply.
Fonts
Main content can use remote URLs for fonts
Recommended CDN: Google Fonts or CDNFonts
Here are the built-in fonts that you can define in your styles.
Microsoft True Type fonts
Andale Mono
Arial Black
Arial (Bold, Italic, Bold Italic)
Comic Sans MS (Bold)
Courier New (Bold, Italic, Bold Italic)
Georgia (Bold, Italic, Bold Italic)
Impact
Times New Roman (Bold, Italic, Bold Italic)
Trebuchet (Bold, Italic, Bold Italic)
Verdana (Bold, Italic, Bold Italic)
Webdings
Others
beng
hosny-amiri
lklug-sinhala
lohit-guru
lohit-knda
samyak-gujr
samyak-mlym
samyak-taml
sarai
sil-abyssinica
sil-padauk
telu thai-tlwg
ttf-wqy-zenhei
arphic-ukai
arphic-uming
ipafont-mincho
ipafont-gothic
uncore
crosextra-caladea
crosextra-carlito
dejavu
dejavu-extra
liberation
liberation2
linuxlibertine
noto-cjk
noto-core
noto-mono
noto-ui-core
sil-gentium
sil-gentium-basic
Page Break
In case that you want to have a page break, you can use this CSS styling to achieve that:
Last updated