Pressjet
← All articles
Accessibility

Give every invoice amount a column header

Carry the meaning of an HTML table into a tagged PDF, then check the reading order.

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

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.

Reference invoice · PDF/UA profile and worker setup

Read nextSign the packet after the last mergeAll articles ↗