# WCAG best practices - print templates (low-code)

## Free tools for verifying print accessibility <a href="#dobrepraktykiwcagszablonywydrukow-lowcode-darmowenarzedziapozwalajaceweryfikowacdostepnoscwydruku" id="dobrepraktykiwcagszablonywydrukow-lowcode-darmowenarzedziapozwalajaceweryfikowacdostepnoscwydruku"></a>

## PAC

PAC - <https://pac.pdf-accessibility.org/en> (Windows) - a tool used to check whether PDF files comply with accessibility requirements. It can be used to verify whether our PDF meets PDF/UA and WCAG standards and generate a report based on that. It also allows you to preview the document structure for a screen reader.

{% hint style="info" %}
It should be noted that PAC is not an official tool created by the ISO committee, but by a third-party company; therefore, the results of its reports and analyses are not the only ones to rely on completely, because they are not the only available tool of this type, and other solutions may offer information and analyses that may differ to some extent.
{% endhint %}

<figure><img src="/files/02b3bf3e394cf10cb5e4b8035c90ac6927526be4" alt=""><figcaption><p><em><strong>Figure 1.</strong> PAC main panel</em></p></figcaption></figure>

<figure><img src="/files/58a95567fe9d3ef23425721af99cd290f672dc0b" alt=""><figcaption><p><em><strong>Figure 2.</strong> Document HTML structure tree</em></p></figcaption></figure>

<figure><img src="/files/624ed1d71c3222916adf357c31c34fe247fac5e6" alt=""><figcaption><p><em><strong>Figure 3.</strong> Document HTML structure preview</em></p></figcaption></figure>

## Axes4

Axes4 - <https://check.axes4.com/en/> - an online tool that generates an accessibility report. It is more limited than the PAC tool in terms of more detailed analysis with error indication, and it does not allow previewing the PDF structure.

<figure><img src="/files/05c4c85d69d058149b9ac7a7436718a9f27f9a02" alt=""><figcaption><p><em><strong>Figure 4.</strong> Accessibility report</em></p></figcaption></figure>

## Screen readers <a href="#dobrepraktykiwcagszablonywydrukow-lowcode-czytnikiekranowe" id="dobrepraktykiwcagszablonywydrukow-lowcode-czytnikiekranowe"></a>

Information is available [here](#dobrepraktykiwcagszablonywydrukow-lowcode-czytnikiekranowe)

## Print metadata declarations <a href="#dobrepraktykiwcagszablonywydrukow-lowcode-deklaracjemetadanychwydruku" id="dobrepraktykiwcagszablonywydrukow-lowcode-deklaracjemetadanychwydruku"></a>

In the context of accessibility **\<fo:declarations>** we can declare metadata or other additional information that do not directly affect the visual formatting.

{% hint style="danger" %}
**\<fo:declarations>** for proper operation in the document structure, it must be placed between the tag **\<fo:layout-master-set>**, and the first **\<fo:page-sequence>**
{% endhint %}

Screen readers can interpret these values. According to UA and WCAG assumptions, the metadata should include **the document title, language, and the DisplayDocTitle setting**. Example declaration:

```
<fo:declarations>
    <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
       <pdf:string key="Lang">pl</pdf:string> <- language declaration
          <pdf:dictionary type="normal" key="ViewerPreferences">
              <pdf:boolean key="DisplayDocTitle">true</pdf:boolean> <- DisplayDocTitle setting
          </pdf:dictionary>
    </pdf:catalog>
    <x:xmpmeta xmlns:x="adobe:ns:meta/">
       <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
         <rdf:Description rdf:about=""
               xmlns:dc="http://purl.org/dc/elements/1.1/">
                    <dc:title>AwZ document</dc:title> <- title
                    <dc:creator>Document author</dc:creator> <- author
                    <dc:description>AwZ document</dc:description> <- description
         </rdf:Description>
       </rdf:RDF>
     </x:xmpmeta>
</fo:declarations>
```

## Assigning the correct tag to email addresses and links <a href="#dobrepraktykiwcagszablonywydrukow-lowcode-nadanieprawidlowegotaguadresowe-mailorazlinkow" id="dobrepraktykiwcagszablonywydrukow-lowcode-nadanieprawidlowegotaguadresowe-mailorazlinkow"></a>

Email addresses and links to external addresses should be contained within the context of the tag **\<fo:basic-link>**

Example:

```xml
<xsl:variable name="wnioskodawca_email"
        select="//wnio:AdresZamieszkania/wnio:AdresPocztyElektronicznej"></xsl:variable>
<xsl:variable name="wnioskodawca_email_link"
        select="concat('mailto:', '$wnioskodawca_email')"></xsl:variable>
...
 
 
<fo:basic-link>
   <xsl:attribute name="external-destination">
       <xsl:value-of select="$wnioskodawca_email_link"/>
   </xsl:attribute>
   <xsl:value-of select="$wnioskodawca_email" />
</fo:basic-link>
```

## Modifying the role of elements <a href="#dobrepraktykiwcagszablonywydrukow-lowcode-modyfikacjarolielementow" id="dobrepraktykiwcagszablonywydrukow-lowcode-modyfikacjarolielementow"></a>

By default, elements are automatically assigned their corresponding types in the generated PDF structure. (H1 to H6 for headings, L for lists, etc.). However, it is possible to override the default roles if we want to improve the default structure using the "role" attribute.

**The default \<fo:block> is assigned the role \<p>**`.`

```
...
<fo:block role="H1" font-weight="bold">Header with H1 tag</fo:block>
<fo:block>Paragraph in the section</fo:block>
...
```

To omit some elements in the PDF structure so that they are not visible to the screen reader, we can use **role="artifact"**. This is useful for skipping elements such as **\<fo:static-content>** such as page headers and footers, which are unhelpful for blind users when read by a screen reader.

Example of use for a header:

```
<fo:static-content flow-name="first-page-header" role="artifact">
     <xsl:call-template name="naglowek1"></xsl:call-template>
</fo:static-content>
```

It is also possible to "wrap" content that we would like to omit in the PDF structure using the <**fo:wrapper>** element with the role "artifact" assigned.

Example for presenting the date format dd-mm-yyyy under the field:

```
<fo:block text-align="center" font-weight="bold">
<fo:wrapper role="artifact">dd - mm - yyyy</fo:wrapper>
</fo:block>
```

## Presentation of empty cells <a href="#dobrepraktykiwcagszablonywydrukow-lowcode-prezentacjapustychkomorek" id="dobrepraktykiwcagszablonywydrukow-lowcode-prezentacjapustychkomorek"></a>

When creating elements that do not need to present a value and may be empty, you should not use a non-breaking space or characters in the same color as the print background.

Example of a template for an unchecked checkbox causing an accessibility report error due to the use of color="white", which results in a white character displayed on a white background:

```xml
xsl:template name="checkbox_template">
        <xsl:param name="checked"></xsl:param>
         <xsl:choose>
            <xsl:when test="$checked = 'true'">
                <fo:inline font-family="ZapfDingbats" font-size="10pt" min-width="12mm">✕</fo:inline>
            </xsl:when>
            <xsl:otherwise>
                <fo:inline font-family="ZapfDingbats" font-size="10pt" color="white" width="100mm">
        ✕</fo:inline>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

```

Instead, it is better to create an empty cell with an assigned style **padding-top** and **padding-bottom**, which will visually give us the same appearance of the cell without the need for any unnecessary character inside it.

```
<xsl:template name="checkbox_template">
    <xsl:param name="checked"></xsl:param>
     <xsl:choose>
        <xsl:when test="$checked = 'true'">
            <fo:block font-size="8pt" min-width="12mm" padding-top="0.1mm" padding-bottom="0.1mm">X</fo:block>
        </xsl:when>
        <xsl:otherwise>
            <fo:block width="100mm" padding-top="2mm" padding-bottom="1.5mm"></fo:block>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>
```

## Spacing between elements - avoiding empty rows <a href="#dobrepraktykiwcagszablonywydrukow-lowcode-odlegloscipomiedzyelementami-unikaniepustychwierszy" id="dobrepraktykiwcagszablonywydrukow-lowcode-odlegloscipomiedzyelementami-unikaniepustychwierszy"></a>

It is bad practice to use elements such as fo:block with non-breaking spaces to increase the spacing between elements in the printout. The same effect can be achieved by using styles such as **margin-top** and **margin-bottom.** This way we avoid unnecessary empty elements in the document structure.

If you want to increase the spacing between rows **\<fo:table-row>** you can use the table property **border-collapse="separate"** and **border-spacing="...".**

For example:

```
<fo:table border-collapse="separate" border-spacing="10pt">
    <fo:table-body>
        <fo:table-row>
            <fo:table-cell border="solid 1pt black">
                <fo:block>Row 1</fo:block>
            </fo:table-cell>
        </fo:table-row>
        <fo:table-row>
            <fo:table-cell border="solid 1pt black">
                <fo:block>Row 2</fo:block>
            </fo:table-cell>
        </fo:table-row>
    </fo:table-body>
</fo:table>
```

{% hint style="info" %}
Accessibility in PDF (Consdata blog article)

[Accessibility in PDF - barrier-free documents](https://blog.consdata.tech/2025/04/28/dostepnosc-w-pdf-dokumenty-bez-barier.html)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/wcag/dobre-praktyki-wcag-szablony-wydrukow-low-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
