FAQ¶
Does kolinsky run JavaScript?¶
No. The HTML is parsed as a browser parses it, but scripts are not run. Generate the final HTML first (with a template engine, or with a browser if the page builds itself with scripts) and give that to kolinsky.
Why are my images, stylesheets or fonts missing?¶
Look at the diagnostics: every resource that does not load gives a resource.* diagnostic with its URL.
The common causes:
- The network is off by default. Allow it with
--allow-net(orallow_network), for all URLs or for a list of URL patterns. See resource loading and security. - No base URL. A document given as a string has no base URL, so a relative reference cannot be
resolved (
resource.unresolved). Passbase_url, or--base-urlon the command line. - The root directory. With
rootset, files outside it are refused (resource.denied).
Why does the PDF differ between two machines?¶
The system fonts differ. For the same output everywhere, turn system fonts off and give the fonts
explicitly (--no-system-fonts --font-dir fonts, or system_fonts(false) with a FontSet), and set
deterministic so that no write time or random file identifier ends up in the file. See
fonts and PDF output.
Some characters show as empty boxes¶
No available font has a glyph for them; each such character gives a glyph.missing diagnostic naming its
code point. Add a font that covers the script, with @font-face or a font directory.
How do I add a header, a footer or page numbers?¶
With the margin boxes of @page, for example @bottom-right { content: counter(page) " / " counter(pages) }.
See pages and page setup; running headers taken from the document are in
footnotes and print CSS.
Can I set the page size from my code instead of the stylesheet?¶
Yes: page_size and margin (--page-size, --margin). They are a fallback: an @page rule of the
document that sets the size or the margin wins for the pages it matches.
Can I check the layout without opening the PDF?¶
Yes. layout (or kolinsky inspect) returns the pages with their sizes and every box with its position in
points, and query finds the boxes of the elements that match a CSS selector. This is how you test that a
table fits on one page or that a heading does not end a page.
Is the engine thread-safe?¶
Yes. An Engine can render from many threads at once; clones share fonts and caches. In Python the engine
releases the GIL while it works. See performance.
Can I use it from another language?¶
Use the command line, or run kolinsky serve --stdio: it keeps one engine and answers JSON requests, one per
line, so a program in any language can render many documents without starting a process for each. The
CLI reference describes it.
Which PDF versions and standards are supported?¶
PDF 1.7 by default; PDF/A-2b, PDF/A-3u and PDF/UA-1 also write PDF 1.7, PDF/A-4 and PDF/UA-2 write PDF 2.0. Tagged PDF is available on its own or with PDF/UA. See PDF output.
Does it write fillable forms or encrypted PDFs?¶
Not in this release: form controls are drawn as they look, without interactive fields, and the PDF is not encrypted.
How fast is it?¶
The benchmarks page gives the time and memory per document, with the machine and the date of the measurement, next to other engines. The conformance page measures how much of CSS, SVG and the PDF features it renders correctly.
What licence is it under?¶
MIT or Apache 2.0, at your choice.