Aller au contenu

Your first template

Ce contenu n’est pas encore disponible dans votre langue.

This page walks you through drawing a template and saving it. It takes about ten minutes the first time.

  1. In the top menu, click PDF templates. The list shows the templates already drawn, grouped by document type.
  2. Click New template in the left menu, or New Customer invoice template (New Quotation template and so on) on the list.
  3. The workshop opens, already filled with a starting layout and the content of your most recent document of that type. If you have none yet, Dolibarr’s specimen document is used.
Left: the template
  • Template name and document type
  • Start from: six ready-made layouts (new template only)
  • Document blocks: show, hide or remove
  • Add a block
  • Table columns
Centre: the page
  • The page as it will print, at scale
  • Drag a block to move it
  • Drag its right edge, bottom edge or corner to resize it
  • Red guides show alignments
Right: the settings
  • Block properties of the selected block
  • Document style: font, colours, orientation, page numbers, watermark
  1. Name the template. Type a name in Template name, for example Invoice with bank details.

  2. Pick a starting layout under Start from. Each one is only a set of blocks and colours, you can change everything afterwards:

    Layout Looks like
    Minimal Plain white page, title on the right, a thin rule above the table.
    Header band Dark band across the top with the title in white, matching band at the bottom.
    Side band Coloured column on the left holding the logo, company details and footer.
    Framed The whole page inside a thin frame, title centred.
    Accent White page, coloured title with an accent bar, tinted totals.
    Compact Narrow margins and small text, to fit many lines on one page.
  3. Move and resize blocks. Drag a block to move it. Drag its right edge, its bottom edge or its corner to resize it. A moved block snaps to the margins, the middle of the page and the edges of other blocks when it comes within 2 mm, and a red guide shows the alignment.

  4. Fine-tune with the keyboard. Click a block, then use the arrow keys to move it by 1 mm, or by 10 mm while holding Shift.

  5. Set up the selected block in Block properties on the right: exact position and size, text size, colours, border and so on. See Block settings.

  6. Show, hide or remove blocks in Document blocks on the left. The checkbox hides a block without losing its settings, the × removes it. Hovering a line of this list highlights the block on the page, which helps to find a block hidden under another one.

  7. Add blocks from Add a block. Frames, rules, images, free texts and label + value fields can be added as many times as you like. Other blocks, such as the logo or the line table, appear in this list only while they are not on the page.

  8. Choose the table columns in Table columns: tick the columns to print, set their width and alignment. See Line table.

  9. Set the document style on the right: font, base size, colours, orientation, page numbers and watermark. See Document style.

  10. Click Save, or PDF preview. The preview saves the template, then opens the real PDF in a new tab, built on your most recent document of that type. It never replaces the PDF already attached to that document.

Your template is now in the list. To have Dolibarr print it, follow Use it on your documents.

  • The page shows real content. The workshop uses the same content as the PDF, taken from your most recent document of that type (its first 12 lines in the table). Open PDF preview for the exact result. An empty image, logo or QR code block is shown as a grey placeholder with its name; an empty text block, such as bank details on a document paid by cheque, shows only its dashed outline.
  • Distances are in millimetres, measured from the top-left corner of the page. An A4 page is 210 × 297 mm in portrait.
  • Blocks that follow the table. The height of the line table depends on the number of lines. Totals, Payment terms, Public note and Free text blocks whose vertical position is 0 are placed right after the table instead of at a fixed height. The workshop draws them there too and shows Placed right after the table under their settings. Up to version 24.4.0, a Public note at 0 was drawn at the top of the page in the workshop, while the PDF placed it after the table.
  • Frames and rules stay behind. A click on the page ignores frames and rules when another block is under the pointer, and selects the smallest block there. A frame placed behind a text never gets in the way. To select a frame covered by other blocks, use its line in Document blocks.