> For the complete documentation index, see [llms.txt](https://docs.eximee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/wcag/dobre-praktyki-wcag-szablony-wydrukow-low-code.md).

# 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 previewing 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 an external company, so the results of its reports and analyses are not the only ones to rely on completely, because it is not the only available tool of this kind, 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> HTML document structure tree</em></p></figcaption></figure>

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

## Axes4

Axes4 - <https://check.axes4.com/en/> - an online tool generating an accessibility report. It is limited compared with PAC in terms of more detailed analysis with error indications and there is no possibility to preview 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>

The information is located [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 does not directly affect visual formatting.

{% hint style="danger" %}
**\<fo:declarations>** for correct operation in the document structure it must be located 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 application 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 included in 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 element roles <a href="#dobrepraktykiwcagszablonywydrukow-lowcode-modyfikacjarolielementow" id="dobrepraktykiwcagszablonywydrukow-lowcode-modyfikacjarolielementow"></a>

By default, elements automatically have corresponding types set 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 by using the "role" attribute.

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

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

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

Example 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>
```

There is also the possibility to "wrap" content that we want to omit in the PDF structure using the <**fo:wrapper>** element with the role set to "artifact".

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

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

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

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

Example of a template for an unchecked checkbox causing an accessibility report error due to the use of color="white", which causes a white character to be 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.

```
<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>

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

When 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 (article on the Consdata blog)

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` 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>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
