Section 508 defines accessibility in the context of electronic documents for the US but it impacts also other countries.

The first implementation of accessibility for Apache FOP was done for the PDF output generator. However, it is based on the new intermediate format, thus the effort to add other output formats should be much smaller than the initial work for PDF.

Implementation - General aspects

The current implementation uses 2 XSLT transforms as a preprocess in Fop.getDefaultHandler. The first addPtr.xsl adds a pointer attribute with an unique value to each FO that appears in the structure tree. The second transform reduceFOTree.xsl removes all elements, attributes and text from the input FO, that are not required in the structure tree. The result from this second transform can be seen in the new IF, where it is split per page-sequence. See the element structure-tree below:

<?xml version="1.0" encoding="UTF-8"?>
<document xmlns="" xmlns:xlink="" xmlns:nav="">
        <x:xmpmeta xmlns:x="adobe:ns:meta/">
            <rdf:RDF xmlns:rdf="">
                <rdf:Description xmlns:xmp="" rdf:about=">
                    <xmp:CreatorTool>Apache FOP Version SVN branches/Temp_AreaTreeNewDesign</xmp:CreatorTool>
            <fo:flow xmlns:fo="">
                <fo:block xmlns:foi="" foi:ptr="N10014"/>
        <page index="0" name="1" page-master-name="1" width="594720" height="792000">
                <viewport width="594720" height="792000">
                    <font family="sans-serif" style="normal" weight="400" variant="normal" size="12000" color="#000000"/>
                    <text x="0" y="10266" ptr="N10014">hello</text>

Enabling accessibility

There are 3 ways to enable accessibility:

  1. Command line The command line option -a turns on accessibility. fop -a -fo testcases/tc1/ -pdf testcases/tc1/tc1.pdf
  2. Embedding userAgent.getRendererOptions().put("accessibility", Boolean.TRUE);
  3. Optional setting in fop.xconf file
    <fop version="1.0">

Changes to your XSL-FO input files

Implementation - PDF specific

Tagged PDF / PDF accessibility links

Testing Tagged PDF's / PDF accessibility

Requirements for tagged PDF's

Additional requirements for accessible PDF's

Screen readers require additional information in tagged PDF files in order to read documents aloud. To enable proper vocalization PDF supports the following features:


Make sure to call the new PDF code when you embed FOP in your Java code: MimeConstants.MIME_PDF + ";mode=painter"

Adjust the Java heap size in order to process larger files.