You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by Apache Wiki <wi...@apache.org> on 2009/10/26 16:41:27 UTC

[Xmlgraphics-fop Wiki] Update of "PDF_Accessibility" by VincentHennebert

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Xmlgraphics-fop Wiki" for change notification.

The "PDF_Accessibility" page has been changed by VincentHennebert.
The comment on this change is: Updated to reflect current implementation, user guide moved to website.
http://wiki.apache.org/xmlgraphics-fop/PDF_Accessibility?action=diff&rev1=4&rev2=5

--------------------------------------------------

  
  '''(R2)''' Providing textual descriptions for images (see PDF Reference 1.4 section 9.8.2, "Alternate Descriptions")  
  
- '''(R3)''' Specifying the natural language used for text in a PDF document - for example, as English or German (see PDF Reference 1.4 section 9.8.1, "Natural Language Specification"). An accessible PDF document should include the document's default language which applies to all text in a PDF document. You can change a language on descendant elements by overriding the document's language.
+ '''(R3)''' Specifying the natural language used for text in a PDF document - for example, as English or German (see PDF Reference 1.4 section 9.8.1, "Natural Language Specification"). An accessible PDF document should include the document's default language which applies to all text in a PDF document. The language can be set on descendant elements by overriding the document's language, but FOP does not currently carry over that information to the PDF output.
- 
- The section [[#head-1aae9f58ba7b221421d56567b1b6a50d9a75792c|Changes to your XSL-FO input files]] will illustrate where you provide this information in the input XSL-FO file.
  
  == Implementation ==
  
- The initial implementation is for PDF output only (as this is the only currently implemented format that supports accessibility) and is based on the code for the new intermediate format.
+ The initial implementation is for PDF output only, as this is the only currently implemented format that supports accessibility.
  
- The challenge is to find the corresponding FO of a text element or image that is sent to the PDFPainter.drawText respectively PDFPainter.drawImage from the LM's. This is required to build the structure tree.
+ The challenge is to find the FO element that corresponds to a piece of text or an image to be rendered. This is required to build the structure tree.
  
- 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:
+ The current implementation uses 2 XSLT transforms as a preprocess in Fop.getDefaultHandler. The first {{{addPtr.xsl}}} adds a pointer attribute with a 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 intermediate XML, where it is split per page-sequence. See the element {{{structure-tree}}} below for the IF ({{{structureTree}}} for Area Tree XML):
  
  {{{ 
  <?xml version="1.0" encoding="UTF-8"?>
@@ -73, +71 @@

  </document>   
  }}}
  
+ The pointer information is passed to the PDF text or image drawing methods. It is used to associate the PDF stream that will be produced out of the text or image to its parent structure element. The intermediate XML formats carry over that information (see elements {{{text}}} and {{{image}}} above).
- The pointer information is also passed to the PDFPainter.drawText and PDFPainter.drawImage method. You can find the pointer attributes in the above IF in the {{{page}}} element in the elements {{{text}}} and {{{image}}}.
- 
- == User Guide ==
- 
- === Enabling PDF accessibility ===
- 
- There are 3 ways to enable PDF accessibility:
- 
-  * '''Command line''' The command line option -a turns on accessibility. {{{fop -a -fo testcases/tc1/tc1.fo -pdf testcases/tc1/tc1.pdf}}}
-  * '''Embedding''' {{{userAgent.getRendererOptions().put("accessibility", Boolean.TRUE);}}}
-  * '''Optional setting in fop.xconf file'''
- {{{  
- <fop version="1.0">
-     <accessibility>true</accessibility>
-     ...
- </fop>
- }}}
- 
- Make sure to call the new PDF code when you embed FOP in your Java code: {{{MimeConstants.MIME_PDF + ";mode=painter"}}}
- === Changes to your XSL-FO input files ===
- 
-  * '''(R1)''' Table cells require a table row as the parent.
-  * '''(R1)''' Ensure that the order of {{{fo:block-container}}} in a page corresponds to the reading order.
-  * '''(R2)''' Alternate text for images: The attribute {{{fox:alt-text}}} has been added for {{{fo:external-graphic}}} and {{{fo:instream-foreign-object}}}.
-  * '''(R3)''' Document's default language: ''The document's default language is currently hard coded to English.''
- 
- === Note ===
- 
- Adjust the Java heap size in order to process larger files.
  
  == TODO ==
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org