The amount “90.00 USD” is easy to understand when you can see “Layout review” to its left and “Amount” above it. A person navigating a table with assistive technology needs those same relationships. Start by expressing them in the source invoice, where your team can review them alongside the business data.
Put structure into the markup
Give the document a language and a meaningful title. Use a heading for the invoice number, a table for the charges and real column headers. The following small invoice contains enough information to test whether an amount retains its context.
<!doctype html>
<html lang="en">
<head><title>Invoice PJ-104</title></head>
<body>
<h1>Invoice PJ-104</h1>
<table>
<thead><tr><th scope="col">Service</th>
<th scope="col">Amount</th></tr></thead>
<tbody><tr><td>Layout review</td><td>90.00 USD</td></tr></tbody>
</table>
<h2>Total due</h2><p>90.00 USD</p>
</body></html>
Save the markup as invoice.html. Send it to
POST /v1/html, which compiles it with the native engine, together with
profile: "pdf-ua-1". Choose an HTTP example to save the
tagged PDF.
jq -n --rawfile html invoice.html \
'{version: 1, profile: "pdf-ua-1", html: $html}' |
curl --fail-with-body -sS http://localhost:8080/v1/html \
-H "Authorization: Bearer $PRESSJET_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary @- -o accessible-invoice.pdf
import { readFile, writeFile } from "node:fs/promises";
import { Pressjet } from "pressjet";
const client = new Pressjet({
baseUrl: "http://localhost:8080",
apiKey: process.env.PRESSJET_API_KEY
});
const html = await readFile("invoice.html", "utf8");
const pdf = await client.html(html, { profile: "pdf-ua-1" });
await writeFile("accessible-invoice.pdf", pdf);
import { readFile, writeFile } from "node:fs/promises";
import { Pressjet } from "pressjet";
const client = new Pressjet({
baseUrl: "http://localhost:8080",
apiKey: process.env.PRESSJET_API_KEY
});
const html: string = await readFile("invoice.html", "utf8");
const pdf = await client.html(html, { profile: "pdf-ua-1" });
await writeFile("accessible-invoice.pdf", pdf);
from os import environ
from pathlib import Path
import pressjet
html = Path("invoice.html").read_text(encoding="utf-8")
with pressjet.Client(api_key=environ["PRESSJET_API_KEY"], base_url="http://localhost:8080") as client:
Path("accessible-invoice.pdf").write_bytes(client.html(html, {"profile": "pdf-ua-1"}))
package main
import (
"context"
"os"
pressjet "github.com/tonysantana1492/pressjet/sdks/go"
)
func must[T any](value T, err error) T {
if err != nil {
panic(err)
}
return value
}
func main() {
ctx := context.Background()
client := pressjet.NewClient()
html := must(os.ReadFile("invoice.html"))
pdf := must(client.HTML(ctx, string(html), &pressjet.HTMLOptions{Profile: "pdf-ua-1"}))
if err := os.WriteFile("accessible-invoice.pdf", pdf, 0644); err != nil {
panic(err)
}
}
<?php
require __DIR__ . '/vendor/autoload.php';
use Pressjet\Client;
$client = new Client(
apiKey: getenv('PRESSJET_API_KEY'),
baseUrl: 'http://localhost:8080',
);
$html = file_get_contents('invoice.html');
if ($html === false) {
throw new RuntimeException('Could not read invoice.html');
}
file_put_contents('accessible-invoice.pdf', $client->html($html, ['profile' => 'pdf-ua-1']));
Inspect a page break with a reader
Repeat the line items until the table spans a page boundary. In the visual PDF, the next page should still identify the columns. In the logical reading order, repeated headers should let the reader follow the same table without encountering a new invoice. Listen to the last item and total. For an attached logo or diagram, check whether its alternative text communicates what a reader needs at that point.
The repository includes a reference invoice that CI checks with veraPDF. Run the same kind of validation on your own template, and also review the names, language and reading order with assistive technology. An automated validator can check structural requirements. A human can hear when a technically present heading makes little sense in context.