Skip to content

Business letter

A letter to a customer about the items remaining on their account. The text is justified and set in the OpenType (CFF) build of Inter, which Tagua subsets like TrueType fonts, so the PDF carries only the letters it uses.

Standards: PDF/A-2b · PDF/UA-1, checked with veraPDF on every change. Download the PDF.

Page 1 of the business letter, rendered by Tagua.
  • Justified paragraphs
  • An OpenType (CFF) font, subset
  • Accented names and addresses
  • PDF/A-2b and PDF/UA-1
letter.report.yaml
# yaml-language-server: $schema=../schema/template.schema.json
# A business letter set in Inter's OpenType (CFF) build, so CI covers CFF font subsetting.
# Also exercises justified text (word spacing with CID fonts), accented text and PDF/A-2b.
version: 1
title: "{Subject}"
culture: en-IE
document:
author: Acme Ltd
compliance: [pdf-a-2b, pdf-ua-1]
page:
size: A4
margins: 25mm
fonts:
InterText: { regular: fonts/Inter-Regular.otf }
styles:
default: { font: InterText, fontSize: 10.5pt, lineHeight: 1.45, color: "#222222" }
muted: { color: "#6B6B6B" }
heading: { fontSize: 15pt, color: "#111111" }
th: { color: "#6B6B6B", borderBottom: "0.5pt solid #BBBBBB", padding: 0 0 2pt 0 }
total: { borderTop: "0.5pt solid #BBBBBB", padding: 2pt 0 0 0 }
data:
letter:
fields: { Recipient: string, Salutation: string, Address: string, Date: date, Subject: string }
items:
fields: { Item: string, Amount: decimal }
body:
dataset: letter
detail:
- layout: row
content:
- { type: text, value: "Acme Ltd\n1 Example Street\nDublin D02 X285", style: muted, width: 1fr }
- { type: text, value: "{Date:D}", align: right, width: 1fr }
- padding: 28pt 0 0 0
content:
- { type: text, value: "{Recipient}\n{Address}" }
- padding: 24pt 0 10pt 0
content:
- { type: text, value: "{Subject}", style: heading, tag: h1 }
- gap: 9pt
content:
- { type: text, value: "Dear {Salutation}," }
- type: text
align: justify
value: >-
Thank you for your order from our São Paulo and Zürich offices. As agreed during our
meeting at the Café Olé in Galway, we have reviewed the account and set out the
remaining items below. The figures include the corrections Seán raised in March;
please let us know if anything looks naïve or out of place.
- type: table
dataset: items
headerStyle: th
columns:
- { header: Item, value: "{Item}", width: 1fr }
- { header: Amount, value: "{Amount:C}", width: 90pt, align: right }
footer:
- style: total
cells:
- { value: Total, isHeader: true }
- { value: "{Sum(Amount):C}", align: right }
- type: text
align: justify
value: >-
Payment is due within thirty days. If you would prefer to settle in instalments, reply
to this letter or write to accounts@acme.example and we will arrange it. Œuvre, Æsop
and Ångström are among the titles still on back order; we will ship them as soon as
they arrive.
- { type: text, value: "Kind regards,\n\nMáire Ní Bhriain\nAccounts, Acme Ltd" }
pageFooter:
- content:
- { type: text, value: "Page {PageNumber} of {TotalPages}", align: right, style: muted, fontSize: 8pt }

Save the template, put the fonts it names next to it (Inter and the Noto fonts are free, under the SIL Open Font License), and run:

Terminal window
tagua render letter.report.yaml --open

Without a data file, tagua render makes up sample rows from the field types; see Preview as you edit.