You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

accessibility.xml 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- $Id$ -->
  17. <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "document-v20.dtd">
  18. <document>
  19. <header>
  20. <title>Apache™ FOP: Accessibility</title>
  21. </header>
  22. <body>
  23. <section id="overview">
  24. <title>Overview</title>
  25. <p>
  26. This page describes the
  27. <a href="http://en.wikipedia.org/wiki/Accessibility">accessibility</a>
  28. features of Apache™ FOP.
  29. <a href="http://www.section508.gov/">Section 508</a> defines accessibility in the context
  30. of electronic documents for the USA but other countries have similar requirements.
  31. </p>
  32. <p>
  33. Accessibility features are available only for the PDF output format and there are some
  34. implementation limitations. Also, certain actions must be undertaken by the content creator
  35. to ensure that FOP can create a truly accessible document.
  36. </p>
  37. </section>
  38. <section>
  39. <title>Enabling accessibility</title>
  40. <p>There are 3 ways to enable accessibility:</p>
  41. <ol>
  42. <li>
  43. <strong>Command line:</strong> The command line option -a turns on accessibility:
  44. <code>fop -a -fo mydocument.fo -pdf mydocument.pdf</code>
  45. </li>
  46. <li>
  47. <strong>Embedding:</strong> <code>userAgent.setAccessibility(true);</code>
  48. </li>
  49. <li>
  50. <strong>Optional setting in fop.xconf file:</strong>
  51. <pre>
  52. &lt;fop version="1.0"&gt;
  53. &lt;accessibility&gt;true&lt;/accessibility&gt;
  54. ...
  55. &lt;/fop&gt;
  56. </pre>
  57. </li>
  58. </ol>
  59. <p>
  60. When accessibility is enabled, additional information relating to the logical structure of
  61. the document is added to the PDF. That information allows the PDF viewer (or a
  62. text-to-speech application) to retrieve the natural reading order of the document.
  63. </p>
  64. <note>The processing of the logical structure is memory-hungry. You may need to adjust the
  65. Java heap size in order to process larger files.</note>
  66. </section>
  67. <section id="source">
  68. <title>Changes to your XSL-FO input files</title>
  69. <p>
  70. Apache FOP cannot automatically generate accessible PDFs. Some of the work can only be
  71. performed by the content provider. Following are some changes that may be necessary to
  72. your XSL-FO content in order to generate really accessible documents:
  73. </p>
  74. <ul>
  75. <li>Table cells must have a table row as their parent.</li>
  76. <li>
  77. Images must have an alternate text: use the <code>fox:alt-text</code> extension attribute
  78. (in the <a href="extensions.html#fox-namespace">fox namespace</a>) on
  79. <code>fo:external-graphic</code> and <code>fo:instream-foreign-object</code> to specify a
  80. short text describing the image.
  81. </li>
  82. <li>
  83. Ensure that the order of <code>fo:block-container</code> elements in a page corresponds to
  84. the reading order.
  85. </li>
  86. <li>
  87. Specify the natural language of the document using the language and country properties
  88. (or via the <code>xml:lang</code> shorthand property).
  89. </li>
  90. </ul>
  91. </section>
  92. <section id="customTags">
  93. <title>Customized Tagging</title>
  94. <p>The <a href="#PDFReference">PDF Reference</a> defines a set of standard Structure Types to
  95. tag content. For example, ‘P’ is used for identifying paragraphs, ‘H1’ to ‘H6’ for headers,
  96. ‘L’ for lists, ‘Div’ for block-level groups of elements, etc. This standard set is aimed at
  97. improving interoperability between applications producing or consuming PDF. </p>
  98. <p>FOP provides a default mapping of Formatting Objects to elements from that standard set.
  99. For example, <code>fo:page-sequence</code> is mapped to ‘Part’, <code>fo:block</code> is
  100. mapped to ‘P’, <code>fo:list-block</code> to ‘L’, etc.</p>
  101. <p>You may want to customize that mapping to improve the accuracy of the tagging or deal with
  102. particular FO constructs. For example, you may want to make use of the ‘H1’ to ‘H6’ tags to
  103. make the hierarchical structure of the document appear in the PDF. This is achieved by using
  104. the <code>role</code> XSL-FO property:</p>
  105. <source>...
  106. &lt;fo:block role="H1" font-weight="bold"&gt;I. A Level 1 Heading&lt;/fo:block&gt;
  107. &lt;fo:block&gt;This is the first paragraph of the first section...&lt;/fo:block&gt;
  108. ...</source>
  109. <p>If a non-standard structure type is specified, FOP will issue a warning and fall back to
  110. the default tag associated to the Formatting Object.</p>
  111. </section>
  112. <section id="testing">
  113. <title>Testing</title>
  114. <p>
  115. Accessible PDFs can be tested, for example, using Adobe Acrobat Professional. Its
  116. Accessibility Check feature creates a report indicating any deficiencies with a PDF
  117. document. Alternatively, you can just let a screen reader read the document aloud.
  118. </p>
  119. </section>
  120. <section id="limitations">
  121. <title>Limitations</title>
  122. <p>
  123. Accessibility support in Apache FOP is relatively new, so there are certain
  124. limitations. Please help us identify and close any gaps.
  125. </p>
  126. <ul>
  127. <li>
  128. The natural language can currently only be specified at the page-sequence level. The
  129. document language is derived from the language of the first page-sequence. It is
  130. currently not possible to override the language inside the content below the
  131. page-sequence level.
  132. </li>
  133. <li>
  134. It's currently not possible to specify the expanded form of an abbreviation or acronym.
  135. </li>
  136. <li>
  137. SVG graphics (or images in general) are treated as a single figure. Text contained in
  138. SVGs is not accessible. It's only possible to work with <code>fox:alt-text</code>.
  139. </li>
  140. <li>
  141. The side regions (region-before, region-after etc.) are currently not specially
  142. identified. Screen readers may read their content at page changes.
  143. </li>
  144. </ul>
  145. </section>
  146. <section id="links">
  147. <title>Related Links</title>
  148. <p>
  149. Many resources providing guidance about creating accessible documents can be found on the
  150. web. Here are a few links, along with additional resources around the topic:
  151. </p>
  152. <ul>
  153. <li><a href="http://www.section508.gov/">US Government - Website on Section 508</a></li>
  154. <li><a href="http://en.wikipedia.org/wiki/Accessibility">Wikipedia on Accessibility in general</a></li>
  155. <li><a href="http://en.wikipedia.org/wiki/Portable_Document_Format#Accessibility">Wikipedia on Accessibility in PDF</a></li>
  156. <li id="PDFReference">
  157. <a href="http://partners.adobe.com/public/developer/en/pdf/PDFReference.pdf">PDF
  158. Reference 1.4</a> (look up chapters 9.7 "Tagged PDF" and 9.8 "Accessibility Support")
  159. </li>
  160. <li><a href="pdfa.html">PDF/A support in Apache FOP</a></li>
  161. <li><a href="http://wiki.apache.org/xmlgraphics-fop/PDF_Accessibility">Developer-oriented details on the accessibility features (on the Wiki)</a></li>
  162. </ul>
  163. </section>
  164. </body>
  165. </document>