Documentation
Accessibility
jasy can emit a tagged PDF with a full structure tree, so screen readers can read the document in
order, announce headings, and describe images. The output is PDF/UA-1 and passes veraPDF's
compliance check. @react-pdf/renderer produces untagged PDFs, so this is a genuine jasy differentiator.
Turn it on
Pass accessible to renderToBytes (or renderPdf). Add a lang and a title - both are part of the
standard, and a title is required for full conformance.
import { Document, Page, Text, renderToBytes } from "@jasy/pdf";
const doc = Document([
Page([
Text("Quarterly Report", { role: "h1", size: 24, bold: true }),
Text("Revenue grew across every region this quarter."),
]),
]);
const bytes = await renderToBytes(doc, {
accessible: true,
lang: "en-US",
title: "Quarterly Report",
});
Declare what things are
The engine builds the structure tree; your components only declare their role.
- Headings and paragraphs -
Text({ role }), whereroleis"h1"through"h6"or"p". - Images -
Image({ alt })gives the figure its alternate text. - Tables - a
Tableis tagged automatically (table, rows, header and data cells), no extra work. - Decoration - anything without a role is marked as an artifact, so screen readers skip it.
Text("Section title", { role: "h2" });
Image({ src: "chart.png", alt: "Revenue by region, Q3" });
Good to know
- Verified, not claimed. The output is checked with veraPDF against PDF/UA-1; a split paragraph or a table that flows across pages stays one logical element in the tree.
- Full conformance needs embedded fonts and a title - the same rule as PDF/A. Use a custom TrueType
font (see Fonts) and pass a
title. - Off by default, zero cost. Without
accessiblethe bytes are identical to before - tagging adds nothing until you ask for it. - Vue and Nuxt too. Pass the same options through
renderToPdf/renderOptions.