You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by ps...@apache.org on 2012/12/11 14:32:02 UTC

svn commit: r1420146 [3/3] - in /xmlgraphics/site/trunk/content/fop: ./ 1.0/ 1.1/ trunk/

Modified: xmlgraphics/site/trunk/content/fop/download.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/download.mdtext?rev=1420146&r1=1420145&r2=1420146&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/download.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/download.mdtext Tue Dec 11 13:31:57 2012
@@ -49,12 +49,13 @@ There are several ways to obtain a sourc
 #### Repository URL
 
 *Main Repository:* [http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/](http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/)
+
 *European Mirror:* [http://svn.eu.apache.org/repos/asf/xmlgraphics/fop/trunk/](http://svn.eu.apache.org/repos/asf/xmlgraphics/fop/trunk/)
 
 ####Web View
 *Main Repository:* [http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/](http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/)
 
-European Mirror: [http://svn.eu.apache.org/viewvc/xmlgraphics/fop/trunk/](http://svn.eu.apache.org/viewvc/xmlgraphics/fop/trunk/)
+*European Mirror:* [http://svn.eu.apache.org/viewvc/xmlgraphics/fop/trunk/](http://svn.eu.apache.org/viewvc/xmlgraphics/fop/trunk/)
 
 With any source distribution, you will need to build FOP from the source files. For details please see the "Build" page on the documentation tab for the version you've downloaded.
 

Modified: xmlgraphics/site/trunk/content/fop/trunk/embedding.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/trunk/embedding.mdtext?rev=1420146&r1=1420145&r2=1420146&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/trunk/embedding.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/trunk/embedding.mdtext Tue Dec 11 13:31:57 2012
@@ -131,17 +131,35 @@ The input XSL-FO document is always rece
 However, you may not always have your input document available as a SAX stream. But with JAXP it's easy to convert different input sources to a SAX stream so you can pipe it into FOP. That sounds more difficult than it is. You simply have to set up the right Source instance as input for the JAXP transformation. A few examples:
 
 
--  **URL:**  `Source src = new StreamSource("http://localhost:8080/testfile.xml");`
+-  **URL:**
 
--  **File:**  `Source src = new StreamSource(new File("C:/Temp/myinputfile.xml"));`
+        :::java
+        Source src = new StreamSource("http://localhost:8080/testfile.xml");
 
--  **String:**  `Source src = new StreamSource(new StringReader(myString)); // myString is a String`
+-  **File:**
 
--  **InputStream:**  `Source src = new StreamSource(new MyInputStream(something));`
+        :::java
+        Source src = new StreamSource(new File("C:/Temp/myinputfile.xml"));
 
--  **Byte Array:**  `Source src = new StreamSource(new ByteArrayInputStream(myBuffer)); // myBuffer is a byte[] here`
+-  **String:**
 
--  **DOM:**  `Source src = new DOMSource(myDocument); // myDocument is a Document or a Node`
+        :::java
+        Source src = new StreamSource(new StringReader(myString)); // myString is a String
+
+-  **InputStream:**
+
+        :::java
+        Source src = new StreamSource(new MyInputStream(something));
+
+-  **Byte Array:**
+
+        :::java
+        Source src = new StreamSource(new ByteArrayInputStream(myBuffer)); // myBuffer is a byte[] here
+
+-  **DOM:**
+
+        :::java
+        Source src = new DOMSource(myDocument); // myDocument is a Document or a Node
 
 -  **Java Objects:** Please have a look at the [Embedding examples](#examples) which contain an example for this.
 
@@ -158,40 +176,41 @@ The FopFactory holds configuration data 
 You can set all sorts of things on the FopFactory:
 
 
--
-The **font base URL** to use when resolving relative URLs for fonts. Example:
+- The **font base URL** to use when resolving relative URLs for fonts. Example:
+
+        :::java
+        fopFactory.getFontManager().setFontBaseURL("file:///C:/Temp/fonts");
 
-    `fopFactory.getFontManager().setFontBaseURL("file:///C:/Temp/fonts");`
+- The **hyphenation base URL** to use when resolving relative URLs for hyphenation patterns. Example:
 
--
-The **hyphenation base URL** to use when resolving relative URLs for hyphenation patterns. Example:
+        :::java
+        fopFactory.setHyphenBaseURL("file:///C:/Temp/hyph");
 
-    `fopFactory.setHyphenBaseURL("file:///C:/Temp/hyph");`
+- Disable **strict validation**. When disabled FOP is less strict about the rules established by the XSL-FO specification. Example:
 
--
-Disable **strict validation**. When disabled FOP is less strict about the rules established by the XSL-FO specification. Example:
+        :::java
+        fopFactory.setStrictValidation(false);
 
-    `fopFactory.setStrictValidation(false);`
+- Enable an **alternative set of rules for text indents** that tries to mimic the behaviour of many commercial FO implementations, that chose to break the specification in this respect. The default of this option is 'false', which causes Apache FOP to behave exactly as described in the specification. To enable the alternative behaviour, call:
 
--
-Enable an **alternative set of rules for text indents** that tries to mimic the behaviour of many commercial FO implementations, that chose to break the specification in this respect. The default of this option is 'false', which causes Apache FOP to behave exactly as described in the specification. To enable the alternative behaviour, call:
+        :::java
+        fopFactory.setBreakIndentInheritanceOnReferenceAreaBoundary(true);
 
-    `fopFactory.setBreakIndentInheritanceOnReferenceAreaBoundary(true);`
+- Set the **source resolution** for the document. This is used internally to determine the pixel size for SVG images and bitmap images without resolution information. Default: 72 dpi. Example:
 
--
-Set the **source resolution** for the document. This is used internally to determine the pixel size for SVG images and bitmap images without resolution information. Default: 72 dpi. Example:
+        :::java
+        fopFactory.setSourceResolution(96); // =96dpi (dots/pixels per Inch)
 
-    `fopFactory.setSourceResolution(96); // =96dpi (dots/pixels per Inch)`
+- Manually add an **ElementMapping instance**. If you want to supply a special FOP extension you can give the instance to the FOUserAgent. Normally, the FOP extensions can be automatically detected (see the documentation on extension for more info). Example:
 
--
-Manually add an **ElementMapping instance**. If you want to supply a special FOP extension you can give the instance to the FOUserAgent. Normally, the FOP extensions can be automatically detected (see the documentation on extension for more info). Example:
+        :::java
+        fopFactory.addElementMapping(myElementMapping); // myElementMapping is a org.apache.fop.fo.ElementMapping
 
-    `fopFactory.addElementMapping(myElementMapping); // myElementMapping is a org.apache.fop.fo.ElementMapping`
+- Set a **URIResolver** for custom URI resolution. By supplying a JAXP URIResolver you can add custom URI resolution functionality to FOP. For example, you can use [Apache XML Commons Resolver](http://xml.apache.org/commons/components/resolver/) to make use of XCatalogs. Example:
 
--
-Set a **URIResolver** for custom URI resolution. By supplying a JAXP URIResolver you can add custom URI resolution functionality to FOP. For example, you can use [Apache XML Commons Resolver](http://xml.apache.org/commons/components/resolver/) to make use of XCatalogs. Example:
+        :::java
+        fopFactory.setURIResolver(myResolver); // myResolver is a javax.xml.transform.URIResolver
 
-    `fopFactory.setURIResolver(myResolver); // myResolver is a javax.xml.transform.URIResolver`
 Both the FopFactory and the FOUserAgent have a method to set a URIResolver. The URIResolver on the FopFactory is primarily used to resolve URIs on factory-level (hyphenation patterns, for example) and it is always used if no other URIResolver (for example on the FOUserAgent) resolved the URI first.
 
 ### Customizing the User Agent {#user-agent}
@@ -207,61 +226,61 @@ The user agent is the entity that allows
 
 You can do all sorts of things on the user agent:
 
+- The **base URL** to use when resolving relative URLs. Example:
 
--
-The **base URL** to use when resolving relative URLs. Example:
+        :::java
+        userAgent.setBaseURL("file:///C:/Temp/");
 
-    `userAgent.setBaseURL("file:///C:/Temp/");`
+- Set the **producer** of the document. This is metadata information that can be used for certain output formats such as PDF. The default producer is "Apache FOP". Example:
 
--
-Set the **producer** of the document. This is metadata information that can be used for certain output formats such as PDF. The default producer is "Apache FOP". Example:
+        :::java
+        userAgent.setProducer("MyKillerApplication");
 
-    `userAgent.setProducer("MyKillerApplication");`
+- Set the **creating user** of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
 
--
-Set the **creating user** of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
+        :::java
+        userAgent.setCreator("John Doe");
 
-    `userAgent.setCreator("John Doe");`
+- Set the **author** of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
 
--
-Set the **author** of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
+        :::java
+        userAgent.setAuthor("John Doe");
 
-    `userAgent.setAuthor("John Doe");`
+- Override the **creation date and time** of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
 
--
-Override the **creation date and time** of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
+        :::java
+        userAgent.setCreationDate(new Date());
 
-    `userAgent.setCreationDate(new Date());`
+- Set the **title** of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
 
--
-Set the **title** of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
+        :::java
+        userAgent.setTitle("Invoice No 138716847");
 
-    `userAgent.setTitle("Invoice No 138716847");`
+- Set the **keywords** of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
 
--
-Set the **keywords** of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
+        :::java
+        userAgent.setKeywords("XML XSL-FO");
 
-    `userAgent.setKeywords("XML XSL-FO");`
+- Set the **target resolution** for the document. This is used to specify the output resolution for bitmap images generated by bitmap renderers (such as the TIFF renderer) and by bitmaps generated by Apache Batik for filter effects and such. Default: 72 dpi. Example:
 
--
-Set the **target resolution** for the document. This is used to specify the output resolution for bitmap images generated by bitmap renderers (such as the TIFF renderer) and by bitmaps generated by Apache Batik for filter effects and such. Default: 72 dpi. Example:
+        :::java
+        userAgent.setTargetResolution(300); // =300dpi (dots/pixels per Inch)
 
-    `userAgent.setTargetResolution(300); // =300dpi (dots/pixels per Inch)`
+- Set **your own Document Handler**. This feature can be used for several purposes, the most likey usage of which would probably be binding a MIME type when the output is Intermediate Format (see [Document Handlers](#documenthandlers)). This also allows advanced users to create their own implementation of the document handler.
 
--
-Set **your own Document Handler**. This feature can be used for several purposes, the most likey usage of which would probably be binding a MIME type when the output is Intermediate Format (see [Document Handlers](#documenthandlers)). This also allows advanced users to create their own implementation of the document handler.
+        :::java
+        userAgent.setDocumentHandlerOverride(documentHandler) // documentHandler is an instance of org.apache.fop.render.intermediate.IFDocumentHandler
 
-    `userAgent.setDocumentHandlerOverride(documentHandler) // documentHandler is an instance of org.apache.fop.render.intermediate.IFDocumentHandler`
+- Set **your own FOEventHandler instance**. If you want to supply your own FOEventHandler or configure an FOEventHandler subclass in a special way you can give the instance to the FOUserAgent. Normally, the FOEventHandler instance is created by FOP. Example:
 
--
-Set **your own FOEventHandler instance**. If you want to supply your own FOEventHandler or configure an FOEventHandler subclass in a special way you can give the instance to the FOUserAgent. Normally, the FOEventHandler instance is created by FOP. Example:
+        :::java
+        userAgent.setFOEventHandlerOverride(myFOEventHandler); // myFOEventHandler is an org.apache.fop.fo.FOEventHandler
 
-    `userAgent.setFOEventHandlerOverride(myFOEventHandler); // myFOEventHandler is an org.apache.fop.fo.FOEventHandler`
+- Set a **URIResolver** for custom URI resolution. By supplying a JAXP URIResolver you can add custom URI resolution functionality to FOP. For example, you can use [Apache XML Commons Resolver](http://xml.apache.org/commons/components/resolver/) to make use of XCatalogs. Example:
 
--
-Set a **URIResolver** for custom URI resolution. By supplying a JAXP URIResolver you can add custom URI resolution functionality to FOP. For example, you can use [Apache XML Commons Resolver](http://xml.apache.org/commons/components/resolver/) to make use of XCatalogs. Example:
+        :::java
+        userAgent.setURIResolver(myResolver); // myResolver is a javax.xml.transform.URIResolver
 
-    `userAgent.setURIResolver(myResolver); // myResolver is a javax.xml.transform.URIResolver`
 Both the FopFactory and the FOUserAgent have a method to set a URIResolver. The URIResolver on the FOUserAgent is used for resolving URIs which are document-related. If it's not set or cannot resolve a URI, the URIResolver from the FopFactory is used. You should not reuse an FOUserAgent instance between FOP rendering runs although you can. Especially in multi-threaded environment, this is a bad idea.
 
 ## Using a Configuration File {#config-external}
@@ -321,10 +340,12 @@ To get the number of pages that were ren
 
 There are several options to consider:
 
-
 - Whenever possible, try to use SAX to couple the individual components involved (parser, XSL transformer, SQL datasource etc.).
 
-- Depending on the target OutputStream (in case of a FileOutputStream, but not for a ByteArrayOutputStream, for example) it may improve performance considerably if you buffer the OutputStream using a BufferedOutputStream: `out = new java.io.BufferedOutputStream(out);`
+- Depending on the target OutputStream (in case of a FileOutputStream, but not for a ByteArrayOutputStream, for example) it may improve performance considerably if you buffer the OutputStream using a BufferedOutputStream:
+
+        :::java
+        out = new java.io.BufferedOutputStream(out);
 
     Make sure you properly close the OutputStream when FOP is finished.
 

Modified: xmlgraphics/site/trunk/content/fop/trunk/output.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/trunk/output.mdtext?rev=1420146&r1=1420145&r2=1420146&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/trunk/output.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/trunk/output.mdtext Tue Dec 11 13:31:57 2012
@@ -16,11 +16,15 @@ Theoretically, there's some potential to
 With a work-around, it is possible to match the PDF/PS output in a Java2D-based renderer pretty closely. The clue is to use the [intermediate format](intermediate.html). The trick is to layout the document using FOP's own font subsystem but then render the document using Java2D. Here are the necessary steps (using the command-line):
 
 
-1. Produce an IF file: `fop -fo myfile.fo -at application/pdf myfile.at.xml`
+1. Produce an IF file:
 
-    Specifying "application/pdf" for the "-at" parameter causes FOP to use FOP's own font subsystem (which is used by the PDF renderer). Note that no PDF file is created in this step.
+    - `fop -fo myfile.fo -at application/pdf myfile.at.xml`
 
-1. Render to a PDF file: `fop -atin myfile.at.xml -pdf myfile.pdf`
+    Specifying "application/pdf" for the "`-at`" parameter causes FOP to use FOP's own font subsystem (which is used by the PDF renderer). Note that no PDF file is created in this step.
+
+1. Render to a PDF file:
+
+    - `fop -atin myfile.at.xml -pdf myfile.pdf`
 
 1. Render to a Java2D-based renderer:
 
@@ -36,10 +40,15 @@ With a work-around, it is possible to ma
 The most obvious way to print your document is to use the FOP [print renderer](#print), which uses the Java2D API (AWT). However, you can also send output from the Postscript renderer directly to a Postscript device, or output from the PCL renderer directly to a PCL device.
 
 Here are Windows command-line examples for Postscript and PCL:
-fop ... -ps \\computername\printerfop ... -pcl \\computername\printer
+
+ `fop ... -ps \\computername\printerfop ... -pcl \\computername\printer`
+
 Here is some Java code to accomplish the task in UNIX:
-proc = Runtime.getRuntime().exec("lp -d" + print_queue + " -o -dp -");
-out = proc.getOutputStream();
+
+    :::java
+    proc = Runtime.getRuntime().exec("lp -d" + print_queue + " -o -dp -");
+    out = proc.getOutputStream();
+
 Set the output MIME type to "application/x-pcl" (MimeConstants.MIME_PCL) and it happily sends the PCL to the UNIX printer queue.
 
 ## PDF {#pdf}
@@ -50,7 +59,9 @@ Note that FOP does not currently support
 
 ### Fonts {#pdf-fonts}
 
-PDF has a set of fonts that are always available to all PDF viewers; to quote from the PDF Specification: *"PDF prescribes a set of 14 standard fonts that can be used without prior definition. These include four faces each of three Latin text typefaces (Courier, Helvetica, and Times), as well as two symbolic fonts (Symbol and ITC Zapf Dingbats). These fonts, or suitable substitute fonts with the same metrics, are guaranteed to be available in all PDF viewer applications."*
+PDF has a set of fonts that are always available to all PDF viewers; to quote from the PDF Specification:
+
+*"PDF prescribes a set of 14 standard fonts that can be used without prior definition. These include four faces each of three Latin text typefaces (Courier, Helvetica, and Times), as well as two symbolic fonts (Symbol and ITC Zapf Dingbats). These fonts, or suitable substitute fonts with the same metrics, are guaranteed to be available in all PDF viewer applications."*
 
 ### Post-processing {#pdf-postprocess}
 

Modified: xmlgraphics/site/trunk/content/fop/trunk/pdfencryption.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/trunk/pdfencryption.mdtext?rev=1420146&r1=1420145&r2=1420146&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/trunk/pdfencryption.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/trunk/pdfencryption.mdtext Tue Dec 11 13:31:57 2012
@@ -131,8 +131,8 @@ The pure Java implementation from [Bounc
 
 1. Open the `java.security` file and add
 
-`security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider`,
+    `security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider`,
 
-preferably at the end of the block defining the other crypto providers. For JDK 1.4 this is detailed on [Sun's web site](http://java.sun.com/j2se/1.4/docs/guide/security/jce/JCERefGuide.html#InstallProvider).
+    preferably at the end of the block defining the other crypto providers. For JDK 1.4 this is detailed on [Sun's web site](http://java.sun.com/j2se/1.4/docs/guide/security/jce/JCERefGuide.html#InstallProvider).
 
 If you have any experience with Mozilla JSS or any other cryptography provider, please post it to the fop-user list.

Modified: xmlgraphics/site/trunk/content/fop/trunk/servlets.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/trunk/servlets.mdtext?rev=1420146&r1=1420145&r2=1420146&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/trunk/servlets.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/trunk/servlets.mdtext Tue Dec 11 13:31:57 2012
@@ -166,7 +166,8 @@ Some versions of Internet Explorer will 
 
 - 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 *not* cache any content retrieved over HTTPS. Setting the `Expires` header entry may help in this case:
 
-    `response.setDateHeader("Expires", System.currentTimeMillis() + cacheExpiringDuration * 1000);`
+        :::java
+        `response.setDateHeader("Expires", System.currentTimeMillis() + cacheExpiringDuration * 1000);`
 
     Consult your server manual and the relevant RFCs for further details on HTTP headers and caching.
 



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