The HTML & CSS publishing engine

Your HTML.
Beautifully published.

From a single invoice to an entire book. Beautifully typeset PDFs and images, rendered locally with the web technologies you already use — straight from the browser, in your desktop or mobile app, or on your servers. Or let our API handle it.

From the browserWebAssembly + nativePDF · SVG · PNG · WebPOffline. On your terms.
book.html + CSS01 / INPUT
<!-- Full manuscript · 106 rendered pages -->
<main class="book">
  <section class="chapter">…</section>
  <!-- All chapters, all paragraphs. -->
</main>

<style>
  p { text-align: justify; hyphens: auto; }
  @page { size: A5; margin: 18mm; }
</style>
Palatine engineWebAssembly · runs locally
COMPLETE
ParseTypesetPaginateExport
783ms106 / 106 pages
02 / PUBLISHEDbook.pdf · 268 KiB
106pages
783 ms.An entire book in under a second

Animated benchmark replay · View measured results
AMD EPYC · 6-core Linux · medians of 3 runs. WASM: warm render, excluding 388 ms initialization. Native: complete CLI process. Source and artwork are illustrative.

More than a conversion

A publishing studio.
Inside your app.

The details that turn a document into something worth reading.

Typography

Knuth–Plass line breaking.

Browsers break justified text one line at a time, and it shows: tight lines next to loose ones, rivers of white. Palatine can compose each paragraph as a whole with the Knuth–Plass algorithm, the one behind TeX, choosing all the breaks together so that every line is evenly spaced.

Add hyphenation penalties, bounded word spacing, last-line control and optical margins, and you get pages that look typeset: books, magazines, long reports, anything that is mostly text.

How Knuth–Plass works
THE SPACE BETWEEN THE WORDS
A line at a time.Browser-style line breaking

Typesetting a book is mostly a matter of patience. Every line of a justified paragraph has to be filled to the same measure, and the space between words is the only thing the compositor can stretch. Break the lines one at a time and a long word at the wrong moment leaves a line full of holes.

Same words. Same width. Different line breaks. An illustration of paragraph-wide composition.

Two ways to publish

Your devices. Or our API.

The same publishing engine. Run it locally, from your users’ browsers to your servers — or call our hosted API when you would rather not.

Local engine · entirely yours

Web technologies.
Rendered locally.

Run the WebAssembly build straight from the browser, in a desktop or mobile app, or the native build on your servers. Your documents never leave the device that makes them.

Volume-basedlicense · 1 year of support and updates

Following years −50%

  • From the browser. The HTML and CSS you know, rendered on your users’ devices.
  • Unlimited documents. No per-document fees, no render time limit.
  • Entirely offline. No network calls, with full control over your data.
Hosted API · ready to call

One request.
We handle the rest.

POST your HTML and CSS from the language you already use. Receive a PDF or image ready to save, send or display — faster than DocRaptor, for a fraction of its price.

€5per month

+ €0.005 / document ~20× less than DocRaptor

  • No rendering infrastructure. We handle rendering and hosting.
  • Pay as you go. Only successfully generated documents count.
  • Every page included. A single page or an entire book, up to 5 minutes per render.
API reference
render.ts
const key = process.env.PALATINE_API_KEY;
const url = "https://api.palatine.page/v1/render";
const response = await fetch(url, {
  method: "POST",
  headers: {
    Authorization: "Bearer " + key,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    html: "<h1>Hi!</h1>", format: "pdf",
  }),
});
if (!response.ok) throw Error(response.statusText);
const pdf = await response.arrayBuffer();
Comparison

Palatine and PrinceXML

Prince is the reference for printing HTML. We test our paged media against Prince 15.1, page by page; here is where the two differ.

PALATINENative · WASM · APIPrinceXMLNative renderer
Direct hosted APIReady to call · €5 / month + €0.005 / documentThrough DocRaptor, a third party
On-premise pricingOne license per build for your entire company and server fleet, priced by volume$2,660–$3,800 per server
Paged mediaMargin boxes, running elements, footnotes, page floats, cross-referencesSame, with more years of edge cases
Paragraph composerKnuth–Plass, opt-inLine by line
Browsers, edge, serverlessWebAssembly: Node, Bun, browsers, WorkersNative binaries only
OutputsPDF, SVG, PNG, WebPPDF, PNG, JPEG
JavaScript, tagged PDFNot supportedSupported

Read the full comparison

The cost of your next million pages

Find your plan.

One page or a whole book.
Choose your monthly volume and compare a month of rendering.

12,000 documents / year
100,000 documents / month
DOCRAPTOR API

Choose a monthly plan.

$75.00/ month

Premium plan
1,250 documents included monthly.

PALATINE LOCAL

Run it yourself.

Volume-basedlicense

From the browser, a desktop or mobile app, or your servers. No per-document fees, no render time limit.

Contact Us

At this volume, choose the Palatine API.Your estimated API cost stays within €250 / month.

Choose the API
Articles

From the blog

Start with the API today.

Sign in with your email, subscribe, create a key. The whole thing takes two minutes.