Tagged PDF files contain information about the structure of the document. The information about the structure is transported via so-called "PDF tags". Tagging a PDF usually makes it more accessible to screen readers, handhelds an similar devices.
Using the setAddTags API method, you can add PDF tags to the PDF documents generated with PDFreactor. If you are generating a PDF from HTML or XHTML documents, the HTML and XHTML elements are automatically mapped to the corresponding PDF tags, so all you have to do is setting this property to enable this feature:
pdfReactor.setAddTags(true);
If you are generating a PDF from another XML language (e.g. DocBook), the elements of this XML language are not mapped to PDF tag types. Instead, they are translated to PDF tags using the XML element name. Thus, the element "para" would be mapped to the PDF tag "para", while the PDF tag type "P" may be more appropriate for this element.
However you can manually map XML elements to PDF tag types using style properties. These style properties are "-ro-pdf-tag-type" and "-ro-alt-text". "-ro-pdf-tag-type" is used to map an element of the XML language you are using to a PDF tag, for example:
para { -ro-pdf-tag-type: "P"; }If you were using DocBook, this would map the DocBook element "para" to the PDF tag "P".
The property "-ro-alt-text" is used to specify an alternative description for an XML element. Example:
img {
-ro-pdf-tag-type: "Figure";
}
img[alt] {
-ro-alt-text: attr(alt);
}The example above maps the XHTML & HTML element "img" to the PDF tag "Figure", and the content of its "alt" attribute to an alternative description for this tag.
If you want to define from which element or attribute in the document the names of the from elements are adopted to a generated PDF, you can use the property "-ro-formelement-name". By default, the names are adopted from the value attribute of the form element.
The name for radio button groups can be adopted in the same way, using the "-ro-radiobuttonelement-group". By default, it will be adopted from the name attribute of the radio button element.