xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r813018 [5/24] - in /websites/staging/xmlgraphics/trunk/content: ./ fop/ fop/0.95/ fop/0.95/images/ fop/1.0/ fop/1.0/images/ fop/dev/ fop/dev/design/ fop/dev/fo/ fop/dev/svg/ fop/fo/ fop/trunk/ fop/trunk/images/
Date Sun, 15 Apr 2012 05:39:54 GMT
Added: websites/staging/xmlgraphics/trunk/content/fop/0.95/running.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/0.95/running.html (added)
+++ websites/staging/xmlgraphics/trunk/content/fop/0.95/running.html Sun Apr 15 05:39:50 2012
@@ -0,0 +1,234 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+  <head>
+    <title>Running Apache™ FOP</title>
+
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <meta property="og:image" content="http://www.apache.org/images/asf_logo.gif" />
+<!--
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/style.css">
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/code.css">
+-->
+    <link href="/css/xmlgraphics.css" rel="stylesheet" type="text/css">
+
+    </style>
+
+    
+
+    
+    
+  </head>
+
+  <body>
+	  <div id="banner">&nbsp;
+	  </div>
+
+	  <div id="navigation">
+	  <h1 id="xml-graphics">XML Graphics</h1>
+<ul>
+<li><a href="/">Overview</a></li>
+<li><a href="/team.html">Who We Are</a></li>
+<li><a href="/legal.html">Legal Stuff</a></li>
+<li><a href="/charter.html">Project Charter</a></li>
+<li><a href="/mail.html">Mailing Lists</a></li>
+<li><a href="/repo.html">Code Repositories</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">ASF Sponsorship Program</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">ASF Thanks</a></li>
+</ul>
+<h1 id="subprojects">Subprojects</h1>
+<ul>
+<li><a href="/batik/">Batik</a></li>
+<li><a href="/fop/">FOP</a></li>
+<li><a href="/commons/">Commons</a></li>
+</ul>
+<form name="search" id="search" action="http://www.google.com/search" method="get">
+  <input value="xmlgraphics.apache.org" name="sitesearch" type="hidden"/>
+  <input type="text" name="q" id="query" /><br />
+  <input type="submit" id="submit" value="Search" />
+</form>
+	  </div>
+	
+	  <div id="bannertext">
+        <a href="/"><img src="/images/apache-xml-graphics.gif" alt="The Apache XML Graphics Project" width="220" heigh="51" /></a>
+        <h1>Running Apache™ FOP</h1>
+      </div>
+        <p><a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/fop/">Fop</a>&nbsp;&raquo&nbsp;<a href="/fop/0.95/">0.95</a></p>
+      </div>
+      <div id="content" class="grid_16"><div class="section-content"><p><version>$Revision: 1298724 $</version></p>
+<h1 id="require">System Requirements</h1>
+<p>The following software must be installed:</p>
+<ul>
+<li>
+<p>Java 1.4.x or later Runtime Environment.</p>
+<ul>
+<li>Many JREs &gt;=1.4 contain older JAXP implementations (which often contain bugs). It's usually a good idea to replace them with a current implementation.</li>
+</ul>
+</li>
+<li>
+<p>Apache™ FOP. The <a href="../download.html">FOP distribution</a> includes all libraries that you will need to run a basic FOP installation. These can be found in the [fop-root]/lib directory. These libraries include the following:</p>
+<ul>
+<li>
+<p><a href="http://xmlgraphics.apache.org/commons/">Apache XML Graphics Commons</a> , an shared library for Batik and FOP.</p>
+</li>
+<li>
+<p><a href="http://xmlgraphics.apache.org/batik/">Apache Batik</a> , an SVG library.</p>
+</li>
+<li>
+<p><a href="http://commons.apache.org/logging/">Apache Commons Logging</a> , a logger abstraction kit.</p>
+</li>
+<li>
+<p><a href="http://commons.apache.org/io/">Apache Commons IO</a> , a library with I/O utilities.</p>
+</li>
+<li>
+<p><a href="http://excalibur.apache.org/framework/">Apache Excalibur/Avalon Framework</a> , for XML configuration handling.</p>
+</li>
+</ul>
+</li>
+</ul>
+<p>The following software is optional, depending on your needs:</p>
+<ul>
+<li>
+<p>Graphics libraries. Generally, FOP contains direct support for the most important bitmap image formats (including PNG, JPEG and GIF). See <a href="graphics.html">FOP: Graphics Formats</a> for details.</p>
+</li>
+<li>
+<p>PDF encryption. See <a href="pdfencryption.html">FOP: PDF Encryption</a> for details.</p>
+</li>
+</ul>
+<p>In addition, the following system requirements apply:</p>
+<ul>
+<li>If you will be using FOP to process SVG, you must do so in a graphical environment. See <a href="graphics.html#batik">FOP: Graphics (Batik)</a> for details.</li>
+</ul>
+<h1 id="install">Installation</h1>
+<h2 id="install-instruct">Instructions</h2>
+<p>Basic FOP installation consists of first unzipping the <code>.gz</code> file that is the distribution medium, then unarchiving the resulting <code>.tar</code> file in a directory/folder that is convenient on your system. Please consult your operating system documentation or Zip application software documentation for instructions specific to your site.</p>
+<h2 id="install-problems">Problems</h2>
+<p>Some Mac OSX users have experienced filename truncation problems using Stuffit to unzip and unarchive their distribution media. This is a legacy of older Mac operating systems, which had a 31-character pathname limit. Several Mac OSX users have recommended that Mac OSX users use the shell command <code>tar -xzf</code> instead.</p>
+<h1 id="standalone-start">Starting FOP as a Standalone Application</h1>
+<h2 id="fop-script">Using the fop script or batch file</h2>
+<p>The usual and recommended practice for starting FOP from the command line is to run the batch file fop.bat (Windows) or the shell script fop (Unix/Linux). These scripts require that the environment variable JAVA_HOME be set to a path pointing to the appropriate Java installation on your system. Macintosh OSX includes a Java environment as part of its distribution. We are told by Mac OSX users that the path to use in this case is <code>/Library/Java/Home</code> . <strong>Caveat:</strong> We suspect that, as Apple releases new Java environments and as FOP upgrades the minimum Java requirements, the two will inevitably not match on some systems. Please see <a href="http://developer.apple.com/java/faq">Java on Mac OSX FAQ</a> for information as it becomes available.</p>
+<p>USAGE
+Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl|-ps|-txt|-at [mime]|-print] <outfile>
+ [OPTIONS]<br />
+  -d                debug mode <br />
+  -x                dump configuration settings<br />
+  -q                quiet mode<br />
+  -c cfg.xml        use additional configuration file cfg.xml
+  -l lang           the language to use for user information 
+  -r                relaxed/less strict validation (where available)
+  -dpi xxx          target resolution in dots per inch (dpi) where xxx is a number
+  -s                for area tree XML, down to block areas only
+  -v                to show FOP version being used</p>
+<p>-o [password]     PDF file will be encrypted with option owner password
+  -u [password]     PDF file will be encrypted with option user password
+  -noprint          PDF file will be encrypted without printing permission
+  -nocopy           PDF file will be encrypted without copy content permission
+  -noedit           PDF file will be encrypted without edit content permission
+  -noannotations    PDF file will be encrypted without edit annotation permission
+  -pdfprofile prof  PDF file will be generated with the specified profile
+                    (Examples for prof: PDF/A-1b or PDF/X-3:2003)</p>
+<p>[INPUT]<br />
+  infile            xsl:fo input file (the same as the next) 
+  -fo  infile       xsl:fo input file<br />
+  -xml infile       xml input file, must be used together with -xsl 
+  -atin infile      area tree input file 
+  -xsl stylesheet   xslt stylesheet </p>
+<p>-param name value <value> to use for parameter <name> in xslt stylesheet
+                    (repeat '-param name value' for each parameter)</p>
+<p>[OUTPUT] 
+  outfile           input will be rendered as PDF into outfile
+  -pdf outfile      input will be rendered as PDF (outfile req'd)
+  -pdfa1b outfile   input will be rendered as PDF/A-1b compliant PDF
+                    (outfile req'd, same as "-pdf outfile -pdfprofile PDF/A-1b")
+  -awt              input will be displayed on screen 
+  -rtf outfile      input will be rendered as RTF (outfile req'd)
+  -pcl outfile      input will be rendered as PCL (outfile req'd) 
+  -ps outfile       input will be rendered as PostScript (outfile req'd) 
+  -afp outfile      input will be rendered as AFP (outfile req'd)
+  -tiff outfile     input will be rendered as TIFF (outfile req'd)
+  -png outfile      input will be rendered as PNG (outfile req'd)
+  -txt outfile      input will be rendered as plain text (outfile req'd) 
+  -at [mime] out    representation of area tree as XML (outfile req'd) 
+                    specify optional mime output to allow AT to be converted
+                    to final format later
+  -print            input file will be rendered and sent to the printer 
+                    see options with "-print help" 
+  -out mime outfile input will be rendered using the given MIME type
+                    (outfile req'd) Example: "-out application/pdf D:\out.pdf"
+                    (Tip: "-out list" prints the list of supported MIME types)
+  -mif outfile      input will be rendered as MIF (FrameMaker) (outfile req'd)
+                    Experimental feature - requires additional fop-sandbox.jar.
+  -svg outfile      input will be rendered as an SVG slides file (outfile req'd) 
+                    Experimental feature - requires additional fop-sandbox.jar.</p>
+<p>-foout outfile    input will only be XSL transformed. The intermediate 
+                    XSL-FO file is saved and no rendering is performed. 
+                    (Only available if you use -xml and -xsl parameters)</p>
+<p>[Examples]
+  Fop foo.fo foo.pdf 
+  Fop -fo foo.fo -pdf foo.pdf (does the same as the previous line)
+  Fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf
+  Fop -xml foo.xml -xsl foo.xsl -foout foo.fo
+  Fop foo.fo -mif foo.mif
+  Fop foo.fo -rtf foo.rtf
+  Fop foo.fo -print or Fop -print foo.fo 
+  Fop foo.fo -awt
+PDF encryption is only available if FOP was compiled with encryption support <strong>and</strong> if compatible encryption support is available at run time. Currently, only the JCE is supported. Check the <a href="pdfencryption.html">Details</a> .</p>
+<h2 id="your-own-script">Writing your own script</h2>
+<p>FOP's entry point for your own scripts is the class <code>org.apache.fop.cli.Main</code> . The general pattern for the command line is: <code>java -classpath &lt;CLASSPATH&gt;
+        org.apache.fop.cli.Main &lt;arguments&gt;</code> . The arguments consist of the options and infile and outfile specifications as shown above for the standard scripts. You may wish to review the standard scripts to make sure that you get your environment properly configured.</p>
+<h2 id="jar-option">Running with java's -jar option</h2>
+<p>As an alternative to the start scripts you can run <code>java
+        -jar path/to/build/fop.jar &lt;arguments&gt;</code> , relying on FOP to build the classpath for running FOP dynamically, see <a href="#dynamical-classpath">below</a> . If you use hyphenation, you must put <code>fop-hyph.jar</code> in the <code>lib</code> directory.</p>
+<p>You can also run <code>java -jar path/to/fop.jar
+      &lt;arguments&gt;</code> , relying on the <code>Class-Path</code> entry in the manifest file. This works if you put <code>fop.jar</code> and all jar files from the <code>lib</code> directory in a single directory. If you use hyphenation, you must also put <code>fop-hyph.jar</code> in that directory.</p>
+<p>In both cases the arguments consist of the options and infile and outfile specifications as shown above for the standard scripts.</p>
+<h2 id="dynamical-classpath">FOP's dynamical classpath construction</h2>
+<p>If FOP is started without a proper classpath, it tries to add its dependencies dynamically. If the system property <code>fop.home</code> contains the name of a directory, then FOP uses that directory as the base directory for its search. Otherwise the current working directory is the base directory. If the base directory is called <code>build</code> , then its parent directory becomes the base directory.</p>
+<p>FOP expects to find <code>fop.jar</code> in the <code>build</code> subdirectory of the base directory, and adds it to the classpath. Subsequently FOP adds all <code>jar</code> files in the lib directory to the classpath. The lib directory is either the <code>lib</code> subdirectory of the base directory, or, if that does not exist, the base directory itself.</p>
+<p>If the system property <code>fop.optional.lib</code> contains the name of a directory, then all <code>jar</code> files in that directory are also added to the classpath. See the methods <code>getJARList</code> and <code>checkDependencies</code> in <code>org.apache.fop.cli.Main</code> .</p>
+<h1 id="check-input">Using Xalan to Check XSL-FO Input</h1>
+<p>FOP sessions that use -xml and -xsl input instead of -fo input are actually controlling two distinct conversions: Tranforming XML to XSL-FO, then formatting the XSL-FO to PDF (or another FOP output format). Although FOP controls both of these processes, the first is included merely as a convenience and for performance reasons. Only the second is part of FOP's core processing. If a user has a problem running FOP, it is important to determine which of these two processes is causing the problem. If the problem is in the first process, the user's stylesheet is likely the cause. The FOP development team does not have resources to help with stylesheet issues, although we have included links to some useful <a href="../resources.html#specs">Specifications</a> and <a href="../resources.html#articles">Books/Articles</a> . If the problem is in the second process, FOP may have a bug or an unimplemented feature that does require attention from the FOP development team.
+The user is always responsible to provide correct XSL-FO code to FOP.
+In the case of using -xml and -xsl input, although the user is responsible for the XSL-FO code that is FOP's input, it is not visible to the user. To make the intermediate FO file visible, the FOP distribution includes the "-foout" option which causes FOP to run only the first (transformation) step, and write the results to a file. (See also the Xalan command-line below)
+When asking for help on the FOP mailing lists, <em>never</em> attach XML and XSL to illustrate the issue. Always run the XSLT step (-foout) and send the resulting XSL-FO file instead. Of course, be sure that the XSL-FO file is correct before sending it.
+The -foout option works the same way as if you would call the <a href="http://xml.apache.org/xalan-j/commandline.html">Xalan command-line</a> :</p>
+<p><code>java org.apache.xalan.xslt.Process -IN xmlfile -XSL file -OUT outfile</code> </p>
+<p>Note that there are some subtle differences between the FOP and Xalan command-lines.</p>
+<h1 id="memory">Memory Usage</h1>
+<p>FOP can consume quite a bit of memory, even though this has been continually improved. This is partly inherent to the formatting process and partly caused by implementation choices. All FO processors currently on the market have memory problems with certain layouts.</p>
+<p>If you are running out of memory when using FOP, here are some ideas that may help:</p>
+<ul>
+<li>
+<p>Increase memory available to the JVM. See <a href="http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/java.html">the -Xmx option</a> for more information.<warning>It is usually unwise to increase the memory allocated to the JVM beyond the amount of physical RAM, as this will generally cause significantly slower performance.</warning></p>
+</li>
+<li>
+<p>Avoid forward references. Forward references are references to some later part of a document. Examples include page number citations which refer to pages which follow the citation, tables of contents at the beginning of a document, and page numbering schemes that include the total number of pages in the document ( <a href="../faq.html#pagenum">"page N of TOTAL"</a> ). Forward references cause all subsequent pages to be held in memory until the reference can be resolved, i.e. until the page with the referenced element is encountered. Forward references may be required by the task, but if you are getting a memory overflow, at least consider the possibility of eliminating them. A table of contents could be replaced by PDF bookmarks instead or moved to the end of the document (reshuffle the paper could after printing).</p>
+</li>
+<li>
+<p>Avoid large images, especially if they are scaled down. If they need to be scaled, scale them in another application upstream from FOP. For many image formats, memory consumption is driven mainly by the size of the image file itself, not its dimensions (width*height), so increasing the compression rate may help.</p>
+</li>
+<li>
+<p>Use multiple page sequences. FOP starts rendering after the end of a page sequence is encountered. While the actual rendering is done page-by-page, some additional memory is freed after the page sequence has been rendered. This can be substantial if the page sequence contains lots of FO elements.</p>
+</li>
+</ul>
+<h1 id="problems">Problems</h1>
+<p>If you have problems running FOP, please see the <a href="../gethelp.html">"How to get Help" page</a> .</p></div></div>
+      <div class="clear"></div>
+
+	  <div id="footer">
+		<a alt="Apache Software Foundation" href="http://www.apache.org">
+		  <img id="asf-logo" alt="Apache Software Foundation" src="/images/feather-small.gif"/ width="100">
+		</a>
+		<div class="copyright">
+		  <p>
+			Copyright &copy; 2011 The Apache Software Foundation, Licensed under
+			the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+			<br />
+			Apache, Apache XML Graphics, the Apache feather logo, and the Apache XML Graphics logos are
+			trademarks of <a href="http://www.apache.org">The Apache Software Foundation</a>. All other
+			marks mentioned may be trademarks or registered trademarks of their respective owners.
+			<br />
+		  </p>
+		</div> 
+	  </div>
+  </body>
+</html>

Added: websites/staging/xmlgraphics/trunk/content/fop/0.95/servlets.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/0.95/servlets.html (added)
+++ websites/staging/xmlgraphics/trunk/content/fop/0.95/servlets.html Sun Apr 15 05:39:50 2012
@@ -0,0 +1,227 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+  <head>
+    <title>Apache™ FOP: Servlets</title>
+
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <meta property="og:image" content="http://www.apache.org/images/asf_logo.gif" />
+<!--
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/style.css">
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/code.css">
+-->
+    <link href="/css/xmlgraphics.css" rel="stylesheet" type="text/css">
+
+    </style>
+
+    
+
+    
+    
+  </head>
+
+  <body>
+	  <div id="banner">&nbsp;
+	  </div>
+
+	  <div id="navigation">
+	  <h1 id="xml-graphics">XML Graphics</h1>
+<ul>
+<li><a href="/">Overview</a></li>
+<li><a href="/team.html">Who We Are</a></li>
+<li><a href="/legal.html">Legal Stuff</a></li>
+<li><a href="/charter.html">Project Charter</a></li>
+<li><a href="/mail.html">Mailing Lists</a></li>
+<li><a href="/repo.html">Code Repositories</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">ASF Sponsorship Program</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">ASF Thanks</a></li>
+</ul>
+<h1 id="subprojects">Subprojects</h1>
+<ul>
+<li><a href="/batik/">Batik</a></li>
+<li><a href="/fop/">FOP</a></li>
+<li><a href="/commons/">Commons</a></li>
+</ul>
+<form name="search" id="search" action="http://www.google.com/search" method="get">
+  <input value="xmlgraphics.apache.org" name="sitesearch" type="hidden"/>
+  <input type="text" name="q" id="query" /><br />
+  <input type="submit" id="submit" value="Search" />
+</form>
+	  </div>
+	
+	  <div id="bannertext">
+        <a href="/"><img src="/images/apache-xml-graphics.gif" alt="The Apache XML Graphics Project" width="220" heigh="51" /></a>
+        <h1>Apache™ FOP: Servlets</h1>
+      </div>
+        <p><a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/fop/">Fop</a>&nbsp;&raquo&nbsp;<a href="/fop/0.95/">0.95</a></p>
+      </div>
+      <div id="content" class="grid_16"><div class="section-content"><p><subtitle>How to use Apache� FOP in a Servlet</subtitle><version>$Revision: 1298724 $</version></p>
+<h1 id="overview">Overview</h1>
+<p>This page discusses topic all around using Apache™ FOP in a servlet environment.</p>
+<h1 id="example-servlets">Example Servlets in the FOP distribution</h1>
+<p>In the directory {fop-dir}/src/java/org/apache/fop/servlet, you'll find a working example of a FOP-enabled servlet.</p>
+<p>The servlet is automatically built when you build Apache FOP using the supplied Ant script. After building the servlet, drop fop.war into the webapps directory of Apache Tomcat (or any other web container). Then, you can use URLs like the following to generate PDF files:</p>
+<ul>
+<li>
+<p>http://localhost:8080/fop/fop?fo=/home/path/to/fofile.fo</p>
+</li>
+<li>
+<p>http://localhost:8080/fop/fop?xml=/home/path/to/xmlfile.xml&amp;xsl=/home/path/to/xslfile.xsl</p>
+</li>
+</ul>
+<p>The source code for the servlet can be found under {fop-dir}/src/java/org/apache/fop/servlet/FopServlet.java.
+This example servlet should not be used on a public web server connected to the Internet as it does not contain any measures to prevent Denial-of-Service-Attacks. It is provided as an example and as a starting point for your own servlet.</p>
+<h1 id="servlet">Create your own Servlet</h1>
+<p>This section assumes you are familiar with <a href="embedding.html">embedding FOP</a> .</p>
+<h2 id="minimal-servlet">A minimal Servlet</h2>
+<p>Here is a minimal code snippet to demonstrate the basics:
+private FopFactory fopFactory = FopFactory.newInstance();
+private TransformerFactory tFactory = TransformerFactory.newInstance();</p>
+<p>public void doGet(HttpServletRequest request,
+                   HttpServletResponse response) throws ServletException {
+    try {
+        response.setContentType("application/pdf");
+        Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, response.getOutputStream());
+        Transformer transformer = tFactory.newTransformer();
+        Source src = new StreamSource("foo.fo");
+        Result res = new SAXResult(fop.getDefaultHandler());
+        transformer.transform(src, res);
+    } catch (Exception ex) {
+        throw new ServletException(ex);
+    }
+}There are numerous problems with the code snippet above. Its purpose is only to demonstrate the basic concepts. See below for details.</p>
+<h2 id="xslt">Adding XSL tranformation (XSLT)</h2>
+<p>A common requirement is to transform an XML source to XSL-FO using an XSL transformation. It is recommended to use JAXP for this task. The following snippet shows the basic code:
+private FopFactory fopFactory = FopFactory.newInstance();
+private TransformerFactory tFactory = TransformerFactory.newInstance();</p>
+<p>public void init() throws ServletException {
+    //Optionally customize the FopFactory and TransformerFactory here
+}</p>
+<p>[..]</p>
+<div class="codehilite"><pre><span class="sr">//</span><span class="n">Setup</span> <span class="n">a</span> <span class="n">buffer</span> <span class="n">to</span> <span class="n">obtain</span> <span class="n">the</span> <span class="n">content</span> <span class="nb">length</span>
+<span class="n">ByteArrayOutputStream</span> <span class="n">out</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ByteArrayOutputStream</span><span class="p">();</span>
+
+<span class="sr">//</span><span class="n">Setup</span> <span class="n">FOP</span>
+<span class="n">Fop</span> <span class="n">fop</span> <span class="o">=</span> <span class="n">fopFactory</span><span class="o">.</span><span class="n">newFop</span><span class="p">(</span><span class="n">MimeConstants</span><span class="o">.</span><span class="n">MIME_PDF</span><span class="p">,</span> <span class="n">out</span><span class="p">);</span>
+
+<span class="sr">//</span><span class="n">Setup</span> <span class="n">Transformer</span>
+<span class="n">Source</span> <span class="n">xsltSrc</span> <span class="o">=</span> <span class="k">new</span> <span class="n">StreamSource</span><span class="p">(</span><span class="k">new</span> <span class="n">File</span><span class="p">(</span><span class="s">&quot;foo-xml2fo.xsl&quot;</span><span class="p">));</span>
+<span class="n">Transformer</span> <span class="n">transformer</span> <span class="o">=</span> <span class="n">tFactory</span><span class="o">.</span><span class="n">newTransformer</span><span class="p">(</span><span class="n">xsltSrc</span><span class="p">);</span>
+
+<span class="sr">//</span><span class="n">Make</span> <span class="n">sure</span> <span class="n">the</span> <span class="n">XSL</span> <span class="n">transformation</span><span class="err">&#39;</span><span class="n">s</span> <span class="n">result</span> <span class="n">is</span> <span class="n">piped</span> <span class="n">through</span> <span class="n">to</span> <span class="n">FOP</span>
+<span class="n">Result</span> <span class="n">res</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SAXResult</span><span class="p">(</span><span class="n">fop</span><span class="o">.</span><span class="n">getDefaultHandler</span><span class="p">());</span>
+
+<span class="sr">//</span><span class="n">Setup</span> <span class="n">input</span>
+<span class="n">Source</span> <span class="n">src</span> <span class="o">=</span> <span class="k">new</span> <span class="n">StreamSource</span><span class="p">(</span><span class="k">new</span> <span class="n">File</span><span class="p">(</span><span class="s">&quot;foo.xml&quot;</span><span class="p">));</span>
+
+<span class="sr">//</span><span class="n">Start</span> <span class="n">the</span> <span class="n">transformation</span> <span class="ow">and</span> <span class="n">rendering</span> <span class="n">process</span>
+<span class="n">transformer</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">src</span><span class="p">,</span> <span class="n">res</span><span class="p">);</span>
+
+<span class="sr">//</span><span class="n">Prepare</span> <span class="n">response</span>
+<span class="n">response</span><span class="o">.</span><span class="n">setContentType</span><span class="p">(</span><span class="s">&quot;application/pdf&quot;</span><span class="p">);</span>
+<span class="n">response</span><span class="o">.</span><span class="n">setContentLength</span><span class="p">(</span><span class="n">out</span><span class="o">.</span><span class="n">size</span><span class="p">());</span>
+
+<span class="sr">//</span><span class="n">Send</span> <span class="n">content</span> <span class="n">to</span> <span class="n">Browser</span>
+<span class="n">response</span><span class="o">.</span><span class="n">getOutputStream</span><span class="p">()</span><span class="o">.</span><span class="nb">write</span><span class="p">(</span><span class="n">out</span><span class="o">.</span><span class="n">toByteArray</span><span class="p">());</span>
+<span class="n">response</span><span class="o">.</span><span class="n">getOutputStream</span><span class="p">()</span><span class="o">.</span><span class="n">flush</span><span class="p">();</span><span class="n">Buffering</span> <span class="n">the</span> <span class="n">generated</span> <span class="n">PDF</span> <span class="n">in</span> <span class="n">a</span> <span class="n">ByteArrayOutputStream</span> <span class="n">is</span> <span class="n">done</span> <span class="n">to</span> <span class="n">avoid</span> <span class="n">potential</span> <span class="n">problems</span> <span class="n">with</span> <span class="n">the</span> <span class="n">Acrobat</span> <span class="n">Reader</span> <span class="n">Plug</span><span class="o">-</span><span class="n">in</span> <span class="n">in</span> <span class="n">Microsoft</span> <span class="n">Internet</span> <span class="n">Explorer</span><span class="o">.</span>
+</pre></div>
+
+
+<p>The <code>Source</code> instance used above is simply an example. If you have to read the XML from a string, supply a <code>new StreamSource(new
+          StringReader(xmlstring))</code> . Constructing and reparsing an XML string is generally less desirable than using a SAXSource if you generate your XML. You can alternatively supply a DOMSource as well. You may also use dynamically generated XSL if you like.</p>
+<p>Because you have an explicit <code>Transformer</code> object, you can also use it to explicitely set parameters for the transformation run.</p>
+<h2 id="cfg">Custom configuration</h2>
+<p>You can easily set up your own FOUserAgent as demonstrated on the <a href="embedding.html">Embedding page</a> .</p>
+<h2 id="performance">Improving performance</h2>
+<p>There are several options to consider:</p>
+<ul>
+<li>
+<p>Instead of java.io.ByteArrayOutputStream consider using the ByteArrayOutputStream implementation from the <a href="http://commons.apache.org/io/">Jakarta Commons IO project</a> which allocates less memory. The full class name is: <code>org.apache.commons.io.output.ByteArrayOutputStream</code> </p>
+</li>
+<li>
+<p>In certain cases it can help to write the generated PDF to a temporary file so you can quickly reuse the file. This is especially useful, if Internet Explorer calls the servlet multiple times with the same request or if you often generate equal PDFs.</p>
+</li>
+</ul>
+<p>Of course, the <a href="embedding.html#performance">performance hints from the Embedding page</a> apply here, too.</p>
+<h2 id="uriresolver">Accessing resources in your web application</h2>
+<p>Often, you will want to use resources (stylesheets, images etc.) which are bundled with your web application. FOP provides a URIResolver implementation that lets you access files via the Servlet's ServletContext. The class is called <code>org.apache.fop.servlet.ServletContextURIResolver</code> .</p>
+<p>Here's how to set it up in your servlet. Instantiate a new instance in the servlet's init() method:</p>
+<div class="codehilite"><pre><span class="sr">/** URIResolver for use by this servlet */</span>
+<span class="n">protected</span> <span class="n">URIResolver</span> <span class="n">uriResolver</span><span class="p">;</span>
+
+<span class="n">public</span> <span class="n">void</span> <span class="n">init</span><span class="p">()</span> <span class="n">throws</span> <span class="n">ServletException</span> <span class="p">{</span>
+    <span class="n">this</span><span class="o">.</span><span class="n">uriResolver</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ServletContextURIResolver</span><span class="p">(</span><span class="n">getServletContext</span><span class="p">());</span>
+    <span class="p">[</span><span class="o">..</span><span class="p">]</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>The ServletContextURIResolver reacts on URIs beginning with "servlet-context:". If you want to access an image in a subdirectory of your web application, you could, for example, use: "servlet-context:/images/myimage.png". Don't forget the leading slash after the colon!</p>
+<p>Further down, you can use the URIResolver for various things:</p>
+<ul>
+<li>
+<p>With the Transformer (JAXP/XSLT) so things like document() functions can resolver "servlet-context:" URIs.</p>
+</li>
+<li>
+<p>With the FopFactory so every resource FOP loads can be loaded using a "servlet-context:" URI.</p>
+</li>
+<li>
+<p>You can the ServletContextURIResolver yourself in your servlet code to access stylesheets or XML files bundled with your web application.</p>
+</li>
+</ul>
+<p>Here are some example snippets:</p>
+<p>//Setting up the JAXP TransformerFactory
+this.transFactory = TransformerFactory.newInstance();
+this.transFactory.setURIResolver(this.uriResolver);</p>
+<p>[..]</p>
+<p>//Setting up the FOP factory
+this.fopFactory = FopFactory.newInstance();
+this.fopFactory.setURIResolver(this.uriResolver);</p>
+<p>[..]</p>
+<p>//The stylesheet for the JAXP Transfomer
+Source xsltSrc = this.uriResolver.resolve(
+    "servlet-context:/xslt/mystylesheet.xsl", null);
+Transformer transformer = this.transFactory.newTransformer(xsltSrc);
+transformer.setURIResolver(this.uriResolver);</p>
+<h1 id="ie">Notes on Microsoft Internet Explorer</h1>
+<p>Some versions of Internet Explorer will not automatically show the PDF or call the servlet multiple times. These are well-known limitations of Internet Explorer and are not a problem of the servlet. However, Internet Explorer can still be used to download the PDF so that it can be viewed later. Here are some suggestions in this context:</p>
+<ul>
+<li>
+<p>Use an URL ending in <code>.pdf</code> , like <code>http://myserver/servlet/stuff.pdf</code> . Yes, the servlet can be configured to handle this. If the URL has to contain parameters, try to have <strong>both</strong> the base URL as well as the last parameter end in <code>.pdf</code> , if necessary append a dummy parameter, like <code>http://myserver/servlet/stuff.pdf?par1=a&amp;par2=b&amp;d=.pdf</code> . The effect may depend on IEx version.</p>
+</li>
+<li>
+<p>Give IEx the opportunity to cache. In particular, ensure the server does not set any headers causing IEx not to cache the content. This may be a real problem if the document is sent over HTTPS, because most IEx installations will by default <em>not</em> cache any content retrieved over HTTPS. Setting the <code>Expires</code> header entry may help in this case:<br></br> <code>response.setDateHeader("Expires",
+          System.currentTimeMillis() + cacheExpiringDuration *
+          1000);</code> <br></br>Consult your server manual and the relevant RFCs for further details on HTTP headers and caching.</p>
+</li>
+<li>
+<p>Cache in the server. It may help to include a parameter in the URL which has a timestamp as the value min order to decide whether a request is repeated. IEx is reported to retrieve a document up to three times, but never more often.</p>
+</li>
+</ul>
+<h1 id="servlet-engine">Servlet Engines</h1>
+<p>When using a servlet engine, there are potential CLASSPATH issues, and potential conflicts with existing XML/XSLT libraries. Servlet containers also often use their own classloaders for loading webapps, which can cause bugs and security problems.</p>
+<h2 id="tomcat">Tomcat</h2>
+<p>Check Tomcat's documentation for detailed instructions about installing FOP and Cocoon. There are known bugs that must be addressed, particularly for Tomcat 4.0.3.</p>
+<h2 id="websphere">WebSphere 3.5</h2>
+<p>Put a copy of a working parser in some directory where WebSphere can access it. For example, if /usr/webapps/yourapp/servlets is the CLASSPATH for your servlets, copy the Xerces jar into it (any other directory would also be fine). Do not add the jar to the servlet CLASSPATH, but add it to the CLASSPATH of the application server which contains your web application. In the WebSphere administration console, click on the "environment" button in the "general" tab. In the "variable name" box, enter "CLASSPATH". In the "value" box, enter the correct path to the parser jar file (/usr/webapps/yourapp/servlets/Xerces.jar in our example here). Press "OK", then apply the change and restart the application server.</p>
+<h1 id="complex-usecases">Handling complex use cases</h1>
+<p>Sometimes the requirements for a servlet get quite sophisticated: SQL data sources, multiple XSL transformations, merging of several datasources etc. In such a case consider using <a href="http://cocoon.apache.org/">Apache Cocoon</a> instead of a custom servlet to accomplish your goal.</p></div></div>
+      <div class="clear"></div>
+
+	  <div id="footer">
+		<a alt="Apache Software Foundation" href="http://www.apache.org">
+		  <img id="asf-logo" alt="Apache Software Foundation" src="/images/feather-small.gif"/ width="100">
+		</a>
+		<div class="copyright">
+		  <p>
+			Copyright &copy; 2011 The Apache Software Foundation, Licensed under
+			the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+			<br />
+			Apache, Apache XML Graphics, the Apache feather logo, and the Apache XML Graphics logos are
+			trademarks of <a href="http://www.apache.org">The Apache Software Foundation</a>. All other
+			marks mentioned may be trademarks or registered trademarks of their respective owners.
+			<br />
+		  </p>
+		</div> 
+	  </div>
+  </body>
+</html>

Added: websites/staging/xmlgraphics/trunk/content/fop/0.95/upgrading.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/0.95/upgrading.html (added)
+++ websites/staging/xmlgraphics/trunk/content/fop/0.95/upgrading.html Sun Apr 15 05:39:50 2012
@@ -0,0 +1,122 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+  <head>
+    <title>Upgrading from an Earlier Version of Apache™ FOP</title>
+
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <meta property="og:image" content="http://www.apache.org/images/asf_logo.gif" />
+<!--
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/style.css">
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/code.css">
+-->
+    <link href="/css/xmlgraphics.css" rel="stylesheet" type="text/css">
+
+    </style>
+
+    
+
+    
+    
+  </head>
+
+  <body>
+	  <div id="banner">&nbsp;
+	  </div>
+
+	  <div id="navigation">
+	  <h1 id="xml-graphics">XML Graphics</h1>
+<ul>
+<li><a href="/">Overview</a></li>
+<li><a href="/team.html">Who We Are</a></li>
+<li><a href="/legal.html">Legal Stuff</a></li>
+<li><a href="/charter.html">Project Charter</a></li>
+<li><a href="/mail.html">Mailing Lists</a></li>
+<li><a href="/repo.html">Code Repositories</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">ASF Sponsorship Program</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">ASF Thanks</a></li>
+</ul>
+<h1 id="subprojects">Subprojects</h1>
+<ul>
+<li><a href="/batik/">Batik</a></li>
+<li><a href="/fop/">FOP</a></li>
+<li><a href="/commons/">Commons</a></li>
+</ul>
+<form name="search" id="search" action="http://www.google.com/search" method="get">
+  <input value="xmlgraphics.apache.org" name="sitesearch" type="hidden"/>
+  <input type="text" name="q" id="query" /><br />
+  <input type="submit" id="submit" value="Search" />
+</form>
+	  </div>
+	
+	  <div id="bannertext">
+        <a href="/"><img src="/images/apache-xml-graphics.gif" alt="The Apache XML Graphics Project" width="220" heigh="51" /></a>
+        <h1>Upgrading from an Earlier Version of Apache™ FOP</h1>
+      </div>
+        <p><a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/fop/">Fop</a>&nbsp;&raquo&nbsp;<a href="/fop/0.95/">0.95</a></p>
+      </div>
+      <div id="content" class="grid_16"><div class="section-content"><p><version>$Revision: 1298724 $</version></p>
+<h1 id="important">Important!</h1>
+<p>If you're planning to upgrade to the latest Apache™ FOP version there are a few very important things to consider:</p>
+<ul>
+<li>
+<p>More than half of the codebase has been rewritten over the last four years. With version 0.93 the code has reached <strong>production level</strong> , and continues to improve with version 0.94 and 0.95.</p>
+</li>
+<li>
+<p>The API of FOP has changed considerably and is not backwards-compatible with versions 0.20.5 and 0.91beta. Version 0.92 introduced the <strong>new stable API</strong> .</p>
+</li>
+<li>
+<p>Since version 0.92 some deprecated methods which were part of the old API have been removed. If you upgrade from 0.91 beta, you will need to adjust your Java code. Similarly if you upgrade from 0.92 and use deprecated methods.</p>
+</li>
+<li>
+<p>If you are using a configuration file for version 0.20.5, you have to rebuild it in the new format. The format of the configuration files has changed since version 0.20.5. See conf/fop.xconf for an example configuration file. A XML Schema file can be found under src/foschema/fop-configuration.xsd.</p>
+</li>
+<li>
+<p>Beginning with version 0.94 you can skip the generation of font metric files and remove the "font-metrics" attribute in the font configuration. The font metrics files are, for the moment, still required if you use a TrueType Collection (*.ttc) and in that case you need to regenerate the font metrics file if yours are from a FOP version before 0.93.</p>
+</li>
+<li>
+<p>The new code is much more strict about the interpretation of the XSL-FO 1.1 specification. Things that worked fine in version 0.20.5 might start to produce warnings or even errors now. FOP 0.20.5 contains many bugs which have been corrected in the new code.
+While FOP 0.20.5 allowed you to have empty <code>fo:table-cell</code> elements, the new code will complain about that (unless relaxed validation is enabled) because the specification demands at least one block-level element ( <code>(%block;)+</code> , see <a href="http://www.w3.org/TR/xsl/#fo_table-cell">XSL-FO 1.1, 6.7.10</a> ) inside an <code>fo:table-cell</code> element.</p>
+</li>
+<li>
+<p>Extensions and Renderers written for version 0.20.5 will not work with the new code! The new FOP extension for <a href="http://barcode4j.sourceforge.net">Barcode4J</a> is available since January 2007.</p>
+</li>
+<li>
+<p>The SVG Renderer and the MIF Handler have not been resurrected, yet! They are currently non-functional and hope for someone to step up and reimplement them.</p>
+</li>
+</ul>
+<h1 id="issues">What you need to know when you upgrade!</h1>
+<p>When you use your existing FO files or XML/XSL files which work fine with FOP version 0.20.5 against this FOP version some things may not work as expected. The following list will hopefully help you to identify and correct those problems. This does not mean that the new FOP is at fault. Quite the opposite actually! See below:</p>
+<ul>
+<li>
+<p>Check the <a href="../compliance.html">Compliance page</a> for the feature causing trouble. It may contain the necessary information to understand and resolve the problem.</p>
+</li>
+<li>
+<p>As stated above empty table cells <code>&lt;fo:table-cell&gt;&lt;/fo:table-cell&gt;</code> are not allowed by the specification. The same applies to empty <code>static-content</code> and <code>block-container</code> elements, for example.</p>
+</li>
+<li>
+<p>0.20.5 is not XSL-FO compliant with respect to sizing images ( <code>external-graphic</code> ) or <code>instream-foreign-object</code> objects. If images or SVGs are sized differently in your outputs with the new FOP version check <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=37136">Bug 37136</a> as it contains some hints on what to do. The file <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/fo/basic/images.fo?view=markup"></a> has a number of good examples that show the new, more correct behaviour.</p>
+</li>
+<li>
+<p>The <code>fox:outline</code> extension is not implemented in this version anymore. It has been superseded by the new bookmark elements from XSL-FO 1.1. So please update your stylesheets accordingly.</p>
+</li>
+</ul></div></div>
+      <div class="clear"></div>
+
+	  <div id="footer">
+		<a alt="Apache Software Foundation" href="http://www.apache.org">
+		  <img id="asf-logo" alt="Apache Software Foundation" src="/images/feather-small.gif"/ width="100">
+		</a>
+		<div class="copyright">
+		  <p>
+			Copyright &copy; 2011 The Apache Software Foundation, Licensed under
+			the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+			<br />
+			Apache, Apache XML Graphics, the Apache feather logo, and the Apache XML Graphics logos are
+			trademarks of <a href="http://www.apache.org">The Apache Software Foundation</a>. All other
+			marks mentioned may be trademarks or registered trademarks of their respective owners.
+			<br />
+		  </p>
+		</div> 
+	  </div>
+  </body>
+</html>

Added: websites/staging/xmlgraphics/trunk/content/fop/1.0/accessibility.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/1.0/accessibility.html (added)
+++ websites/staging/xmlgraphics/trunk/content/fop/1.0/accessibility.html Sun Apr 15 05:39:50 2012
@@ -0,0 +1,162 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+  <head>
+    <title>Apache™ FOP: Accessibility</title>
+
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <meta property="og:image" content="http://www.apache.org/images/asf_logo.gif" />
+<!--
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/style.css">
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/code.css">
+-->
+    <link href="/css/xmlgraphics.css" rel="stylesheet" type="text/css">
+
+    </style>
+
+    
+
+    
+    
+  </head>
+
+  <body>
+	  <div id="banner">&nbsp;
+	  </div>
+
+	  <div id="navigation">
+	  <h1 id="xml-graphics">XML Graphics</h1>
+<ul>
+<li><a href="/">Overview</a></li>
+<li><a href="/team.html">Who We Are</a></li>
+<li><a href="/legal.html">Legal Stuff</a></li>
+<li><a href="/charter.html">Project Charter</a></li>
+<li><a href="/mail.html">Mailing Lists</a></li>
+<li><a href="/repo.html">Code Repositories</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">ASF Sponsorship Program</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">ASF Thanks</a></li>
+</ul>
+<h1 id="subprojects">Subprojects</h1>
+<ul>
+<li><a href="/batik/">Batik</a></li>
+<li><a href="/fop/">FOP</a></li>
+<li><a href="/commons/">Commons</a></li>
+</ul>
+<form name="search" id="search" action="http://www.google.com/search" method="get">
+  <input value="xmlgraphics.apache.org" name="sitesearch" type="hidden"/>
+  <input type="text" name="q" id="query" /><br />
+  <input type="submit" id="submit" value="Search" />
+</form>
+	  </div>
+	
+	  <div id="bannertext">
+        <a href="/"><img src="/images/apache-xml-graphics.gif" alt="The Apache XML Graphics Project" width="220" heigh="51" /></a>
+        <h1>Apache™ FOP: Accessibility</h1>
+      </div>
+        <p><a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/fop/">Fop</a>&nbsp;&raquo&nbsp;<a href="/fop/1.0/">1.0</a></p>
+      </div>
+      <div id="content" class="grid_16"><div class="section-content"><h1 id="overview">Overview</h1>
+<p>This page describes the <a href="http://en.wikipedia.org/wiki/Accessibility">accessibility</a> features of Apache™ FOP. <a href="http://www.section508.gov/">Section 508</a> defines accessibility in the context of electronic documents for the USA but other countries have similar requirements.</p>
+<p>Accessibility features are available only for the PDF output format and there are some implementation limitations. Also, certain actions must be undertaken by the content creator to ensure that FOP can create a truly accessible document.</p>
+<h1 id="enabling-accessibility-enablingaccessibility">Enabling accessibility # {#Enabling+accessibility}</h1>
+<p>There are 3 ways to enable accessibility:</p>
+<ol>
+<li>
+<p><strong>Command line:</strong> The command line option -a turns on accessibility: <code>fop -a -fo mydocument.fo -pdf mydocument.pdf</code> </p>
+</li>
+<li>
+<p><strong>Embedding:</strong>  <code>userAgent.setAccessibility(true);</code> </p>
+</li>
+<li>
+<p><strong>Optional setting in fop.xconf file:</strong>  <code>&lt;fop version="1.0"&gt;
+              &lt;accessibility&gt;true&lt;/accessibility&gt;
+              ...
+          &lt;/fop&gt;</code> </p>
+</li>
+</ol>
+<p>When accessibility is enabled, additional information relating to the logical structure of the document is added to the PDF. That information allows the PDF viewer (or a text-to-speech application) to retrieve the natural reading order of the document.
+The processing of the logical structure is memory-hungry. You may need to adjust the Java heap size in order to process larger files.</p>
+<h1 id="source">Changes to your XSL-FO input files</h1>
+<p>Apache FOP cannot automatically generate accessible PDFs. Some of the work can only be performed by the content provider. Following are some changes that may be necessary to your XSL-FO content in order to generate really accessible documents:</p>
+<ul>
+<li>
+<p>Table cells must have a table row as their parent.</p>
+</li>
+<li>
+<p>Images must have an alternate text: use the <code>fox:alt-text</code> extension attribute (in the <a href="extensions.html#fox-namespace">fox namespace</a> ) on <code>fo:external-graphic</code> and <code>fo:instream-foreign-object</code> to specify a short text describing the image.</p>
+</li>
+<li>
+<p>Ensure that the order of <code>fo:block-container</code> elements in a page corresponds to the reading order.</p>
+</li>
+<li>
+<p>Specify the natural language of the document using the language and country properties (or via the <code>xml:lang</code> shorthand property).</p>
+</li>
+</ul>
+<h1 id="customTags">Customized Tagging</h1>
+<p>The <a href="#PDFReference">PDF Reference</a> defines a set of standard Structure Types to tag content. For example, ‘P’ is used for identifying paragraphs, ‘H1’ to ‘H6’ for headers, ‘L’ for lists, ‘Div’ for block-level groups of elements, etc. This standard set is aimed at improving interoperability between applications producing or consuming PDF.</p>
+<p>FOP provides a default mapping of Formatting Objects to elements from that standard set. For example, <code>fo:page-sequence</code> is mapped to ‘Part’, <code>fo:block</code> is mapped to ‘P’, <code>fo:list-block</code> to ‘L’, etc.</p>
+<p>You may want to customize that mapping to improve the accuracy of the tagging or deal with particular FO constructs. For example, you may want to make use of the ‘H1’ to ‘H6’ tags to make the hierarchical structure of the document appear in the PDF. This is achieved by using the <code>role</code> XSL-FO property:
+...
+<fo:block role="H1" font-weight="bold">I. A Level 1 Heading</fo:block>
+<fo:block>This is the first paragraph of the first section...</fo:block>
+...
+If a non-standard structure type is specified, FOP will issue a warning and fall back to the default tag associated to the Formatting Object.</p>
+<h1 id="testing">Testing</h1>
+<p>Accessible PDFs can be tested, for example, using Adobe Acrobat Professional. Its Accessibility Check feature creates a report indicating any deficiencies with a PDF document. Alternatively, you can just let a screen reader read the document aloud.</p>
+<h1 id="limitations">Limitations</h1>
+<p>Accessibility support in Apache FOP is relatively new, so there are certain limitations. Please help us identify and close any gaps.</p>
+<ul>
+<li>
+<p>The natural language can currently only be specified at the page-sequence level. The document language is derived from the language of the first page-sequence. It is currently not possible to override the language inside the content below the page-sequence level.</p>
+</li>
+<li>
+<p>It's currently not possible to specify the expanded form of an abbreviation or acronym.</p>
+</li>
+<li>
+<p>SVG graphics (or images in general) are treated as a single figure. Text contained in SVGs is not accessible. It's only possible to work with <code>fox:alt-text</code> .</p>
+</li>
+<li>
+<p>The side regions (region-before, region-after etc.) are currently not specially identified. Screen readers may read their content at page changes.</p>
+</li>
+</ul>
+<h1 id="links">Related Links</h1>
+<p>Many resources providing guidance about creating accessible documents can be found on the web. Here are a few links, along with additional resources around the topic:</p>
+<ul>
+<li>
+<p><a href="http://www.section508.gov/">US Government - Website on Section 508</a> </p>
+</li>
+<li>
+<p><a href="http://en.wikipedia.org/wiki/Accessibility">Wikipedia on Accessibility in general</a> </p>
+</li>
+<li>
+<p><a href="http://en.wikipedia.org/wiki/Portable_Document_Format#Accessibility">Wikipedia on Accessibility in PDF</a> </p>
+</li>
+<li>
+<p><a href="http://partners.adobe.com/public/developer/en/pdf/PDFReference.pdf">PDF Reference 1.4</a> (look up chapters 9.7 "Tagged PDF" and 9.8 "Accessibility Support")</p>
+</li>
+<li>
+<p><a href="pdfa.html">PDF/A support in Apache FOP</a> </p>
+</li>
+<li>
+<p><a href="http://wiki.apache.org/xmlgraphics-fop/PDF_Accessibility">Developer-oriented details on the accessibility features (on the Wiki)</a> </p>
+</li>
+</ul></div></div>
+      <div class="clear"></div>
+
+	  <div id="footer">
+		<a alt="Apache Software Foundation" href="http://www.apache.org">
+		  <img id="asf-logo" alt="Apache Software Foundation" src="/images/feather-small.gif"/ width="100">
+		</a>
+		<div class="copyright">
+		  <p>
+			Copyright &copy; 2011 The Apache Software Foundation, Licensed under
+			the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+			<br />
+			Apache, Apache XML Graphics, the Apache feather logo, and the Apache XML Graphics logos are
+			trademarks of <a href="http://www.apache.org">The Apache Software Foundation</a>. All other
+			marks mentioned may be trademarks or registered trademarks of their respective owners.
+			<br />
+		  </p>
+		</div> 
+	  </div>
+  </body>
+</html>

Added: websites/staging/xmlgraphics/trunk/content/fop/1.0/anttask.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/1.0/anttask.html (added)
+++ websites/staging/xmlgraphics/trunk/content/fop/1.0/anttask.html Sun Apr 15 05:39:50 2012
@@ -0,0 +1,162 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+  <head>
+    <title>Apache™ FOP: Ant task</title>
+
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <meta property="og:image" content="http://www.apache.org/images/asf_logo.gif" />
+<!--
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/style.css">
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/code.css">
+-->
+    <link href="/css/xmlgraphics.css" rel="stylesheet" type="text/css">
+
+    </style>
+
+    
+
+    
+    
+  </head>
+
+  <body>
+	  <div id="banner">&nbsp;
+	  </div>
+
+	  <div id="navigation">
+	  <h1 id="xml-graphics">XML Graphics</h1>
+<ul>
+<li><a href="/">Overview</a></li>
+<li><a href="/team.html">Who We Are</a></li>
+<li><a href="/legal.html">Legal Stuff</a></li>
+<li><a href="/charter.html">Project Charter</a></li>
+<li><a href="/mail.html">Mailing Lists</a></li>
+<li><a href="/repo.html">Code Repositories</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">ASF Sponsorship Program</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">ASF Thanks</a></li>
+</ul>
+<h1 id="subprojects">Subprojects</h1>
+<ul>
+<li><a href="/batik/">Batik</a></li>
+<li><a href="/fop/">FOP</a></li>
+<li><a href="/commons/">Commons</a></li>
+</ul>
+<form name="search" id="search" action="http://www.google.com/search" method="get">
+  <input value="xmlgraphics.apache.org" name="sitesearch" type="hidden"/>
+  <input type="text" name="q" id="query" /><br />
+  <input type="submit" id="submit" value="Search" />
+</form>
+	  </div>
+	
+	  <div id="bannertext">
+        <a href="/"><img src="/images/apache-xml-graphics.gif" alt="The Apache XML Graphics Project" width="220" heigh="51" /></a>
+        <h1>Apache™ FOP: Ant task</h1>
+      </div>
+        <p><a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/fop/">Fop</a>&nbsp;&raquo&nbsp;<a href="/fop/1.0/">1.0</a></p>
+      </div>
+      <div id="content" class="grid_16"><div class="section-content"><p><version>$Revision: 1298724 $</version></p>
+<p>Apache™ FOP provides an Ant task for automating the document build process.</p>
+<h1 id="basics">Description</h1>
+<p>The FOP Ant task will convert XSL-FO documents to PDF, PS, PCL etc. output (see <a href="output.html">Output formats</a> for available formats).</p>
+<p>To call FOP tasks within Ant, first add a FOP task definition to your Ant build file. One method of defining the task is as follows:</p>
+<property name="fop.home" value="....path to your FOP HOME directory..."/>
+
+<taskdef name="fop" 
+         classname="org.apache.fop.tools.anttasks.Fop">
+  <classpath>
+    <fileset dir="${fop.home}/lib">
+      <include name="*.jar"/>
+    </fileset>
+    <fileset dir="${fop.home}/build">
+      <include name="fop.jar"/>
+      <include name="fop-hyph.jar" />
+    </fileset>
+  </classpath>
+</taskdef>
+
+Then create FOP tasks within your Ant build file, using the FOP task parameters listed below.
+
+# Parameters for FOP Ant task # {#parameters}
+
+<caption>Parameters specified as attributes</caption>| Attribute | Description | Required |
+|-----------|-------------|----------|
+| fofile | XSL-FO file to be rendered | Yes, if no fileset nested element is used |
+| xmlfile | XML input file | Yes, if no fofile is specified |
+| xsltfile | XSLT input file | Yes, if no fofile is specified |
+| outfile | Output filename | Yes, when fofile is used. (This attribute is not valid for filesets.) |
+| format | Possible output formats:<br></br> `application/X-fop-awt-preview` <br></br> `application/X-fop-print` <br></br> `application/X-fop-areatree` <br></br> `application/pdf` <br></br> `application/postscript` <br></br> `application/mif` <br></br> `application/rtf` , `text/richtext` , `text/rtf` <br></br> `application/x-pcl` , `application/vnd.hp-PCL` <br></br> `application/x-afp` , `application/vnd.ibm.modcap` <br></br> `text/plain` <br></br> `image/svg+xml` <br></br> `image/gif` <br></br> `image/png` <br></br> `image/tiff` <br></br> | No, defaults to `application/pdf`  |
+| outdir | Output directory | Required if a fileset is used to specify the files to render; optional for fofile. (Can alternatively specify the full path in the fofile value.) |
+| force | Recreate target files, even if they are newer than their corresponding source files. Note: This attribute is available in post-0.20.5 versions (0.20.x nightly build and 1.0dev) only; target files are always generated (i.e., force=true) in 0.20.5 release. | No, default is `false`  |
+| basedir | Base directory to resolve relative references (e.g., graphics files) within the FO document. | No, for single FO File entry, default is to use the location of that FO file. |
+| relativebase | For fileset usage only. A value of `true` specifies using the location of each .fo file as the base directory for resolving relative file references located within that .fo file. A value of `false` specifies using the value of basedir for all files within the fileset, or just the current working directory if basedir is not specified. | No, default is `false` . |
+| userconfig | User configuration file (same as the FOP "-c" command line option). | No |
+| messagelevel | Logging level<br></br>Possible values: `error` , `warn` , `info` , `verbose` , `debug` . **Currently doesn't work in FOP Trunk!!!**  | No, defaults to `verbose`  |
+| logFiles | Controls whether the names of the files that are processed are logged ( `true` ) or not ( `false` ). **Currently doesn't work in FOP Trunk!!!**  | No, default is `true`  |
+| throwexceptions | Controls whether or not an exception is thrown if an error occurs during rendering. | Default is `true`  |
+
+<caption>Parameters specified as nested elements</caption>| Attribute | Description | Required |
+|-----------|-------------|----------|
+| fileset |  [FileSets](http://ant.apache.org/manual/CoreTypes/fileset.html) are used to specify multiple XSL-FO files to be rendered. | Yes, if no fofile attribute is supplied |
+
+# Examples # {#examples}
+
+The following example converts a single XSL-FO file to a PDF document:
+
+<target name="generate-pdf" description="Generates a single PDF file">
+   <fop format="application/pdf" 
+        fofile="c:\working\foDirectory\foDocument.fo"
+        outfile="c:\working\pdfDirectory\pdfDocument.pdf" />
+</target>
+
+This example converts all XSL-FO files within an entire directory to PostScript:
+
+<target name="generate-multiple-ps" 
+        description="Generates multiple PostScript files">
+   <fop format="application/postscript" 
+        outdir="${build.dir}" messagelevel="debug">
+        <fileset dir="${fo.examples.dir}">
+           <include name="*.fo"/>
+        </fileset>
+   </fop>
+</target>
+
+The following example transforms and converts a single XML and XSLT file to an AFP document:
+
+<target name="generate-afp-from-transform" description="Generates a single AFP file from an XSLT stylesheet">
+   <fop format="application/x-afp" 
+        xmlfile="c:\working\foDirectory\Document.xml"
+        xsltfile="c:\working\foDirectory\Document.xslt"
+        outfile="c:\working\afpDirectory\Document.afp" />
+</target>
+
+This example transforms and converts all XML files within an entire directory to PostScript:
+
+<target name="generate-multiple-ps-from-transform" description="Generates multiple PostScript files using an XSLT stylesheet">
+   <fop format="application/postscript" 
+        xsltfile="c:\working\foDirectory\Document.xslt"
+        outdir="${build.dir}" messagelevel="debug">
+        <fileset dir="${test.dir}">
+           <include name="*.xml"/>
+        </fileset>
+   </fop>
+</target></div></div>
+      <div class="clear"></div>
+
+	  <div id="footer">
+		<a alt="Apache Software Foundation" href="http://www.apache.org">
+		  <img id="asf-logo" alt="Apache Software Foundation" src="/images/feather-small.gif"/ width="100">
+		</a>
+		<div class="copyright">
+		  <p>
+			Copyright &copy; 2011 The Apache Software Foundation, Licensed under
+			the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+			<br />
+			Apache, Apache XML Graphics, the Apache feather logo, and the Apache XML Graphics logos are
+			trademarks of <a href="http://www.apache.org">The Apache Software Foundation</a>. All other
+			marks mentioned may be trademarks or registered trademarks of their respective owners.
+			<br />
+		  </p>
+		</div> 
+	  </div>
+  </body>
+</html>



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


Mime
View raw message