First template

All layout configurations are done using CSS.

If you are accustomed to configuring page size and other document aspects (such as fonts) using PHP with other PDF renderers, you will appreciate the ability to do so using CSS and the official Print-CSS syntax with

The following example shows how to create a simple A5 page using a Google font:

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>My first template</title>
    @import url(',wght@0,400;0,700;1,400;1,700&display=swap');
    @page {
        size: A5;
        margin: 10mm;
    Hello World

All layout-related configurations are done using CSS inside your document. The official CSS standard includes special properties and rules for printed and paged media such as PDF.

For more information on paged media in CSS, refer to the official reference at

Last updated