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/03 16:46:44 UTC
svn commit: r1416565 [5/5] - in /xmlgraphics/site/trunk/content/fop: 0.95/
1.0/ 1.1/ trunk/
Modified: xmlgraphics/site/trunk/content/fop/1.1/output.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/1.1/output.mdtext?rev=1416565&r1=1416564&r2=1416565&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/1.1/output.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/1.1/output.mdtext Mon Dec 3 15:46:33 2012
@@ -57,47 +57,48 @@ FOP does not currently support several d
Another popular post-processing tool is [iText](http://www.lowagie.com/iText) , which has tools for adding security features, document properties, watermarks, and many other features to PDF files.
<warning>Caveat: iText may swallow PDF bookmarks. But [Jens Stavnstrup tells us](http://issues.apache.org/bugzilla/show_bug.cgi?id=37589) that this doesn't happen if you use iText's PDFStamper.</warning>
Here is some sample code that uses iText to encrypt a FOP-generated PDF. (Note that FOP now supports [PDF encryption](pdfencryption.html) . However the principles for using iText for other PDF features are similar.)
-public static void main(String args[]) {
- try {
- ByteArrayOutputStream fopout = new ByteArrayOutputStream();
- FileOutputStream outfile = new FileOutputStream(args[2]);
- FopFactory fopFactory = FopFactory.newInstance();
- Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, fopout);
-
- Transformer transformer = TransformerFactory.newInstance().newTransformer(
- new StreamSource(new File(args[1])));
- transformer.transform(new StreamSource(new File(args[0])),
- new SAXResult(fop.getDefaultHandler()));
- PdfReader reader = new PdfReader(fopout.toByteArray());
- int n = reader.getNumberOfPages();
- Document document = new Document(reader.getPageSizeWithRotation(1));
- PdfWriter writer = PdfWriter.getInstance(document, outfile);
- writer.setEncryption(PdfWriter.STRENGTH40BITS, "pdf", null,
- PdfWriter.AllowCopy);
- document.open();
- PdfContentByte cb = writer.getDirectContent();
- PdfImportedPage page;
- int rotation;
- int i = 0;
- while (i < n) {
- i++;
- document.setPageSize(reader.getPageSizeWithRotation(i));
- document.newPage();
- page = writer.getImportedPage(reader, i);
- rotation = reader.getPageRotation(i);
- if (rotation == 90 || rotation == 270) {
- cb.addTemplate(page, 0, -1f, 1f, 0, 0,
- reader.getPageSizeWithRotation(i).height());
- } else {
- cb.addTemplate(page, 1f, 0, 0, 1f, 0, 0);
+
+ public static void main(String args[]) {
+ try {
+ ByteArrayOutputStream fopout = new ByteArrayOutputStream();
+ FileOutputStream outfile = new FileOutputStream(args[2]);
+ FopFactory fopFactory = FopFactory.newInstance();
+ Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, fopout);
+
+ Transformer transformer = TransformerFactory.newInstance().newTransformer(
+ new StreamSource(new File(args[1])));
+ transformer.transform(new StreamSource(new File(args[0])),
+ new SAXResult(fop.getDefaultHandler()));
+ PdfReader reader = new PdfReader(fopout.toByteArray());
+ int n = reader.getNumberOfPages();
+ Document document = new Document(reader.getPageSizeWithRotation(1));
+ PdfWriter writer = PdfWriter.getInstance(document, outfile);
+ writer.setEncryption(PdfWriter.STRENGTH40BITS, "pdf", null,
+ PdfWriter.AllowCopy);
+ document.open();
+ PdfContentByte cb = writer.getDirectContent();
+ PdfImportedPage page;
+ int rotation;
+ int i = 0;
+ while (i < n) {
+ i++;
+ document.setPageSize(reader.getPageSizeWithRotation(i));
+ document.newPage();
+ page = writer.getImportedPage(reader, i);
+ rotation = reader.getPageRotation(i);
+ if (rotation == 90 || rotation == 270) {
+ cb.addTemplate(page, 0, -1f, 1f, 0, 0,
+ reader.getPageSizeWithRotation(i).height());
+ } else {
+ cb.addTemplate(page, 1f, 0, 0, 1f, 0, 0);
+ }
+ System.out.println("Processed page " + i);
+ }
+ document.close();
+ } catch( Exception e) {
+ e.printStackTrace();
}
- System.out.println("Processed page " + i);
}
- document.close();
- } catch( Exception e) {
- e.printStackTrace();
- }
-}
Check the iText tutorial and documentation for setting access flags, password, encryption strength and other parameters.
### Watermarks <a id="pdf-watermark"></a>
@@ -113,10 +114,10 @@ In addition to the [PDF Post-processing]
The PDF Renderer supports some PDF specific extensions which can be embedded into the input FO document. To use the extensions the appropriate namespace must be declared in the fo:root element like this:
-<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
-### Embedded Files ## <a id="pdf-embedded-file"></a>
+#### Embedded Files<a id="pdf-embedded-file"></a>
It is possible to attach/embed arbitrary files into a PDF file. You can give a name and a description of the file. Example:
@@ -129,7 +130,7 @@ It is possible to attach/embed arbitrary
It is also possible to reference an embedded file from an `fo:basic-link` . Use the special "embedded-file:" URI scheme with the filename as single argument after the URI scheme. Example:
-<fo:basic-link external-destination="url(embedded-file:image.jpg)">Attached Image</fo:basic-link>
+ <fo:basic-link external-destination="url(embedded-file:image.jpg)">Attached Image</fo:basic-link>
Note: Not all PDF Viewers (including some Acrobat Versions) will open the embedded file when clicking on the link. In that case, the user will have to open he attachment via the separate list of file attachments.
@@ -140,14 +141,15 @@ The PostScript renderer has been brought
### Configuration <a id="ps-configuration"></a>
The PostScript renderer configuration currently allows the following settings:
-<renderer mime="application/postscript">
- <auto-rotate-landscape>false</auto-rotate-landscape>
- <language-level>3</language-level>
- <optimize-resources>false</optimize-resources>
- <safe-set-page-device>false</safe-set-page-device>
- <dsc-compliant>true</dsc-compliant>
- <rendering>quality</rendering>
-</renderer>
+
+ <renderer mime="application/postscript">
+ <auto-rotate-landscape>false</auto-rotate-landscape>
+ <language-level>3</language-level>
+ <optimize-resources>false</optimize-resources>
+ <safe-set-page-device>false</safe-set-page-device>
+ <dsc-compliant>true</dsc-compliant>
+ <rendering>quality</rendering>
+ </renderer>
The default value for the "auto-rotate-landscape" setting is "false". Setting it to "true" will automatically rotate landscape pages and will mark them as landscape.
The default value for the "language-level" setting is "3". This setting specifies the PostScript language level which should be used by FOP. Set this to "2" only if you don't have a Level 3 capable interpreter.
@@ -206,11 +208,12 @@ The output created by the PCLRenderer is
### Configuration <a id="pcl-configuration"></a>
The PCL renderer configuration currently allows the following settings:
-<renderer mime="application/x-pcl">
- <rendering>quality</rendering>
- <text-rendering>bitmap</text-rendering>
- <disable-pjl>false</disable-pjl>
-</renderer>
+
+ <renderer mime="application/x-pcl">
+ <rendering>quality</rendering>
+ <text-rendering>bitmap</text-rendering>
+ <disable-pjl>false</disable-pjl>
+ </renderer>
The default value for the "rendering" setting is "speed" which causes borders to be painted as plain rectangles. In this mode, no special borders (dotted, dashed etc.) are available. If you want support for all border modes, set the value to "quality" as indicated above. This will cause the borders to be painted as bitmaps.
The default value for the "text-rendering" setting is "auto" which paints the base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D. If the mix of painting methods results in unwelcome output, you can set this to "bitmap" which causes all text to be rendered as bitmaps.
@@ -226,7 +229,7 @@ The PCL Renderer supports some PCL speci
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:pcl="http://xmlgraphics.apache.org/fop/extensions/pcl">
-#### Page Source (Tray selection) ## <a id="pcl-page-source"></a>
+#### Page Source (Tray selection)<a id="pcl-page-source"></a>
The page-source extension attribute on fo:simple-page-master allows to select the paper tray the sheet for a particular simple-page-master is to be taken from. Example:
@@ -238,7 +241,7 @@ The page-source extension attribute on f
Note: the tray number is a positive integer and the value depends on the target printer. Not all PCL printers support the same paper trays. Usually, "1" is the default tray, "2" is the manual paper feed, "3" is the manual envelope feed, "4" is the "lower" tray and "7" is "auto-select". Consult the technical reference for your printer for all available values.
-#### Output Bin ## <a id="pcl-output-bin"></a>
+#### Output Bin<a id="pcl-output-bin"></a>
The `output-bin` extension attribute on fo:simple-page-master allows to select the output bin into which the printed output should be fed. Example:
@@ -250,7 +253,7 @@ The `output-bin` extension attribute on
Note: the output bin number is a positive integer and the value depends on the target printer. Not all PCL printers support the same output bins. Usually, "1" is the upper output bin, "2" is the lower (rear) output bin. Consult the technical reference for your printer for all available values.
-#### Page Duplex Mode ## <a id="pcl-duplex-mode"></a>
+#### Page Duplex Mode<a id="pcl-duplex-mode"></a>
The duplex-mode extension attribute on fo:simple-page-master allows to select the duplex mode to be used for a particular simple-page-master. Example:
@@ -300,13 +303,14 @@ There are still a big number of older (o
### Configuration <a id="afp-configuration"></a>
-#### Fonts ## <a id="afp-font-config"></a>
+#### Fonts<a id="afp-font-config"></a>
The AFP Renderer requires special configuration particularly related to fonts. AFP Render configuration is done through the normal FOP configuration file. The MIME type for the AFP Renderer is application/x-afp which means the AFP Renderer section in the FOP configuration file looks like:
-<renderer mime="application/x-afp">
- <!-- AFP Renderer -->
- ...
-</renderer>
+
+ <renderer mime="application/x-afp">
+ <!-- AFP Renderer -->
+ ...
+ </renderer>
There are 4 font configuration variants supported:
@@ -319,139 +323,143 @@ There are 4 font configuration variants
1. FOP built-in Base14 fonts
A typical raster font configuration looks like:
- <!-- This is an example of mapping actual IBM raster fonts / code pages to a FOP font -->
- <font>
- <!-- The afp-font element defines the IBM code page, the matching Java encoding and the
- base URI for the font -->
- <afp-font type="raster" codepage="T1V10500" encoding="Cp500" base-uri="fonts/ibm/">
- <!-- For a raster font a separate element for each font size is required providing
- the font size and the corresponding IBM Character set name -->
- <afp-raster-font size="7" characterset="C0N20070"/>
- <afp-raster-font size="8" characterset="C0N20080"/>
- <afp-raster-font size="10" characterset="C0N20000"/>
- <afp-raster-font size="11" characterset="C0N200A0"/>
- <afp-raster-font size="12" characterset="C0N200B0"/>
- <afp-raster-font size="14" characterset="C0N200D0"/>
- <afp-raster-font size="16" characterset="C0N200F0"/>
- <afp-raster-font size="18" characterset="C0N200H0"/>
- <afp-raster-font size="20" characterset="C0N200J0"/>
- <afp-raster-font size="24" characterset="C0N200N0"/>
- <afp-raster-font size="30" characterset="C0N200T0"/>
- <afp-raster-font size="36" characterset="C0N200Z0"/>
- </afp-font>
- <!-- These are the usual FOP font triplets as they apply to this font -->
- <font-triplet name="serif" style="normal" weight="normal"/>
- <font-triplet name="Times" style="normal" weight="normal"/>
- <font-triplet name="Times-Roman" style="normal" weight="normal"/>
- <font-triplet name="TimesNewRoman" style="normal" weight="normal"/>
- </font>
-An outline font configuration is simpler as the individual font size entries are not required. However, the characterset definition is now required within the afp-font element.
+
+ <!-- This is an example of mapping actual IBM raster fonts / code pages to a FOP font -->
<font>
- <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH200 "
- base-uri="file:/fonts/ibm" />
- <font-triplet name="sans-serif" style="normal" weight="normal"/>
- <font-triplet name="Helvetica" style="normal" weight="normal"/>
- <font-triplet name="any" style="normal" weight="normal"/>
- </font>
+ <!-- The afp-font element defines the IBM code page, the matching Java encoding and the
+ base URI for the font -->
+ <afp-font type="raster" codepage="T1V10500" encoding="Cp500" base-uri="fonts/ibm/">
+ <!-- For a raster font a separate element for each font size is required providing
+ the font size and the corresponding IBM Character set name -->
+ <afp-raster-font size="7" characterset="C0N20070"/>
+ <afp-raster-font size="8" characterset="C0N20080"/>
+ <afp-raster-font size="10" characterset="C0N20000"/>
+ <afp-raster-font size="11" characterset="C0N200A0"/>
+ <afp-raster-font size="12" characterset="C0N200B0"/>
+ <afp-raster-font size="14" characterset="C0N200D0"/>
+ <afp-raster-font size="16" characterset="C0N200F0"/>
+ <afp-raster-font size="18" characterset="C0N200H0"/>
+ <afp-raster-font size="20" characterset="C0N200J0"/>
+ <afp-raster-font size="24" characterset="C0N200N0"/>
+ <afp-raster-font size="30" characterset="C0N200T0"/>
+ <afp-raster-font size="36" characterset="C0N200Z0"/>
+ </afp-font>
+ <!-- These are the usual FOP font triplets as they apply to this font -->
+ <font-triplet name="serif" style="normal" weight="normal"/>
+ <font-triplet name="Times" style="normal" weight="normal"/>
+ <font-triplet name="Times-Roman" style="normal" weight="normal"/>
+ <font-triplet name="TimesNewRoman" style="normal" weight="normal"/>
+ </font>
+An outline font configuration is simpler as the individual font size entries are not required. However, the characterset definition is now required within the afp-font element.
+
+ <font>
+ <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH200 "
+ base-uri="file:/fonts/ibm" />
+ <font-triplet name="sans-serif" style="normal" weight="normal"/>
+ <font-triplet name="Helvetica" style="normal" weight="normal"/>
+ <font-triplet name="any" style="normal" weight="normal"/>
+ </font>
If "base-uri" is missing or a relative URI, the fonts are resolved relative to the font base URI specified in the configuration (or on the FopFactory).
Previously, the location of the font files was given by the "path" attribute. This is still supported for the time being, but you should move to using the more flexible "base-uri" attribute so you can profit from the power of URI resolvers.
A CID-keyed font (Type 0, double-byte outline font) configuration is much the same as an outline font. However, the characterset definition is now required within the afp-font element.
- <font>
- <afp-font type="CIDKeyed" characterset="CZJHMNU"
- codepage="T1120000" encoding="UnicodeBigUnmarked"
- base-uri="file:/fonts/ibm" />
- <font-triplet name="J-Heisei Mincho" style="normal" weight="normal" />
- </font>
+
+ <font>
+ <afp-font type="CIDKeyed" characterset="CZJHMNU"
+ codepage="T1120000" encoding="UnicodeBigUnmarked"
+ base-uri="file:/fonts/ibm" />
+ <font-triplet name="J-Heisei Mincho" style="normal" weight="normal" />
+ </font>
Note that the value of the encoding attribute in the example is the double-byte encoding 'UnicodeBigUnmarked' (UTF-16BE).
Experimentation has shown that the font metrics for the FOP built-in Base14 fonts are actually very similar to some of the IBM outline and raster fonts. In cases were the IBM font files are not available the base-uri attribute in the afp-font element can be replaced by a base14-font attribute giving the name of the matching Base14 font. In this case the AFP Renderer will take the font metrics from the built-in font.
- <!-- The following are examples of defining outline fonts based on FOP built-in
- font metrics for the Adobe Base14 fonts -->
- <!-- sans-serif fonts based on Helvetica -->
- <font>
- <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH200 "
- base14-font="Helvetica" />
- <font-triplet name="sans-serif" style="normal" weight="normal"/>
- <font-triplet name="Helvetica" style="normal" weight="normal"/>
- <font-triplet name="any" style="normal" weight="normal"/>
- </font>
- <font>
- <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH300 "
- base14-font="HelveticaOblique" />
- <font-triplet name="sans-serif" style="italic" weight="normal"/>
- <font-triplet name="Helvetica" style="italic" weight="normal"/>
- <font-triplet name="any" style="italic" weight="normal"/>
- </font>
- <font>
- <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH400 "
- base14-font="HelveticaBold" />
- <font-triplet name="sans-serif" style="normal" weight="bold"/>
- <font-triplet name="Helvetica" style="normal" weight="bold"/>
- <font-triplet name="any" style="normal" weight="bold"/>
- </font>
- <font>
- <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH500 "
- base14-font="HelveticaBoldOblique" />
- <font-triplet name="sans-serif" style="italic" weight="bold"/>
- <font-triplet name="Helvetica" style="italic" weight="bold"/>
- <font-triplet name="any" style="italic" weight="bold"/>
- </font>
+
+ <!-- The following are examples of defining outline fonts based on FOP built-in
+ font metrics for the Adobe Base14 fonts -->
+ <!-- sans-serif fonts based on Helvetica -->
+ <font>
+ <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH200 "
+ base14-font="Helvetica" />
+ <font-triplet name="sans-serif" style="normal" weight="normal"/>
+ <font-triplet name="Helvetica" style="normal" weight="normal"/>
+ <font-triplet name="any" style="normal" weight="normal"/>
+ </font>
+ <font>
+ <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH300 "
+ base14-font="HelveticaOblique" />
+ <font-triplet name="sans-serif" style="italic" weight="normal"/>
+ <font-triplet name="Helvetica" style="italic" weight="normal"/>
+ <font-triplet name="any" style="italic" weight="normal"/>
+ </font>
+ <font>
+ <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH400 "
+ base14-font="HelveticaBold" />
+ <font-triplet name="sans-serif" style="normal" weight="bold"/>
+ <font-triplet name="Helvetica" style="normal" weight="bold"/>
+ <font-triplet name="any" style="normal" weight="bold"/>
+ </font>
+ <font>
+ <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH500 "
+ base14-font="HelveticaBoldOblique" />
+ <font-triplet name="sans-serif" style="italic" weight="bold"/>
+ <font-triplet name="Helvetica" style="italic" weight="bold"/>
+ <font-triplet name="any" style="italic" weight="bold"/>
+ </font>
- <!-- serif fonts based on Times Roman -->
- <font>
- <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZN200 "
- base14-font="TimesRoman" />
- <font-triplet name="serif" style="normal" weight="normal"/>
- <font-triplet name="Times" style="normal" weight="normal"/>
- <font-triplet name="Times-Roman" style="normal" weight="normal"/>
- </font>
-
- <!-- The following are examples of defining raster fonts based on FOP built-in
- font metrics for the Adobe Base14 fonts -->
- <!-- monospaced fonts based on Courier -->
- <font>
- <afp-font type="raster" codepage="T1V10500" encoding="Cp500">
- <afp-raster-font size="7" characterset="C0420070" base14-font="Courier"/>
- <afp-raster-font size="8" characterset="C0420080" base14-font="Courier"/>
- <afp-raster-font size="10" characterset="C0420000" base14-font="Courier"/>
- <afp-raster-font size="12" characterset="C04200B0" base14-font="Courier"/>
- <afp-raster-font size="14" characterset="C04200D0" base14-font="Courier"/>
- <afp-raster-font size="20" characterset="C04200J0" base14-font="Courier"/>
- </afp-font>
- <font-triplet name="monospace" style="normal" weight="normal"/>
- <font-triplet name="Courier" style="normal" weight="normal"/>
- </font>
- <font>
- <afp-font type="raster" codepage="T1V10500" encoding="Cp500">
- <afp-raster-font size="7" characterset="C0440070" base14-font="CourierBold"/>
- <afp-raster-font size="8" characterset="C0440080" base14-font="CourierBold"/>
- <afp-raster-font size="10" characterset="C0440000" base14-font="CourierBold"/>
- <afp-raster-font size="12" characterset="C04400B0" base14-font="CourierBold"/>
- <afp-raster-font size="14" characterset="C04400D0" base14-font="CourierBold"/>
- <afp-raster-font size="20" characterset="C04400J0" base14-font="CourierBold"/>
- </afp-font>
- <font-triplet name="monospace" style="normal" weight="bold"/>
- <font-triplet name="Courier" style="normal" weight="bold"/>
- </font>
+ <!-- serif fonts based on Times Roman -->
+ <font>
+ <afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZN200 "
+ base14-font="TimesRoman" />
+ <font-triplet name="serif" style="normal" weight="normal"/>
+ <font-triplet name="Times" style="normal" weight="normal"/>
+ <font-triplet name="Times-Roman" style="normal" weight="normal"/>
+ </font>
+
+ <!-- The following are examples of defining raster fonts based on FOP built-in
+ font metrics for the Adobe Base14 fonts -->
+ <!-- monospaced fonts based on Courier -->
+ <font>
+ <afp-font type="raster" codepage="T1V10500" encoding="Cp500">
+ <afp-raster-font size="7" characterset="C0420070" base14-font="Courier"/>
+ <afp-raster-font size="8" characterset="C0420080" base14-font="Courier"/>
+ <afp-raster-font size="10" characterset="C0420000" base14-font="Courier"/>
+ <afp-raster-font size="12" characterset="C04200B0" base14-font="Courier"/>
+ <afp-raster-font size="14" characterset="C04200D0" base14-font="Courier"/>
+ <afp-raster-font size="20" characterset="C04200J0" base14-font="Courier"/>
+ </afp-font>
+ <font-triplet name="monospace" style="normal" weight="normal"/>
+ <font-triplet name="Courier" style="normal" weight="normal"/>
+ </font>
+ <font>
+ <afp-font type="raster" codepage="T1V10500" encoding="Cp500">
+ <afp-raster-font size="7" characterset="C0440070" base14-font="CourierBold"/>
+ <afp-raster-font size="8" characterset="C0440080" base14-font="CourierBold"/>
+ <afp-raster-font size="10" characterset="C0440000" base14-font="CourierBold"/>
+ <afp-raster-font size="12" characterset="C04400B0" base14-font="CourierBold"/>
+ <afp-raster-font size="14" characterset="C04400D0" base14-font="CourierBold"/>
+ <afp-raster-font size="20" characterset="C04400J0" base14-font="CourierBold"/>
+ </afp-font>
+ <font-triplet name="monospace" style="normal" weight="bold"/>
+ <font-triplet name="Courier" style="normal" weight="bold"/>
+ </font>
By default, all manually configured fonts are embedded, unless they are matched in the [section of the configuration file](fonts.html#embedding) . However, the default fonts shown above will not be embedded.
For double byte EBCDIC encoded character sets, there is an optional tag that must be set to prevent characters from being miscoded. This defaults to "false" if not specified.
<afp-font type="CIDKeyed" codepage="T10835 " encoding="Cp937" characterset="CZTKAI" ebcdic-dbcs="true"/>
-### Output Resolution ## <a id="afp-renderer-resolution-config"></a>
+#### Output Resolution<a id="afp-renderer-resolution-config"></a>
By default the AFP Renderer creates output with a resolution of 240 dpi. This can be overridden by the <renderer-resolution/> configuration element. Example:
<renderer-resolution>240</renderer-resolution>
-### Line Width Correction ## <a id="afp-line-width-correction-config"></a>
+#### Line Width Correction<a id="afp-line-width-correction-config"></a>
The default line width in AFP is device dependent. This means that a line width specified in, say, a SVG source file may not render the way it was intended. The output AFP line with can be corrected by the <line-width-correction/> configuration element. Example:
<line-width-correction>2.5</line-width-correction>
-### Images ## <a id="afp-image-config"></a>
+#### Images<a id="afp-image-config"></a>
By default the AFP Renderer converts all images to 8 bit grey level. This can be overridden by the <images/> configuration element. Example:
@@ -486,7 +494,8 @@ By default, JPEG images are rasterized t
<images mode="color" cmyk="true">
<jpeg allow-embedding="false" bitmap-encoding-quality="0.8"/>
</images>
-### GOCA (Vector Graphics) ## <a id="afp-goca-config"></a>
+
+#### GOCA (Vector Graphics)<a id="afp-goca-config"></a>
Not all AFP implementations support GOCA. Some also have bugs related to GOCA. Therefore, it is desirable to have some control over the generation of GOCA graphics.
@@ -498,19 +507,19 @@ Some AFP implementations have trouble re
<goca enabled="true" text="shapes"/>
If you disable GOCA or let text render as shapes, the size of the generated AFP usually increases considerably.
-#### Shading ## <a id="afp-shading-config"></a>
+#### Shading<a id="afp-shading-config"></a>
By default, filled rectangles are painted using their given color using a PTOCA I-axis rule (DIR). But not all environments handle these colors correctly. That's why a setting is supported that paints the rectangles using an ordered dither pattern (bi-level) with an inline IOCA FS10 image that is used together with the "replicate and trim" mapping. The optional "shading" element can be used to control the shading mode. Its default value is "color". To enable the dithered mode, use "dithered". Example:
<shading>dithered</shading>
-#### Resource Group File ## <a id="afp-resource-group-file"></a>
+#### Resource Group File<a id="afp-resource-group-file"></a>
By default the AFP Renderer will place all data resource objects such as images within the document of the main output datastream. An external resource group file where document resources may be specified with the <resource-group-file/> configuration element. Example:
<resource-group-file>external_resources.afp</resource-group-file>
Be careful when using this option not to overwrite existing resource files from previous rendering runs.
-### Resource Level Defaults ## <a id="afp-resource-level-defaults"></a>
+#### Resource Level Defaults<a id="afp-resource-level-defaults"></a>
By default, bitmap image objects (or page segments derived from them) are put in the print-file-level resource group and GOCA graphics are inlined for compatibility with the AFP Workbench tool.
@@ -526,7 +535,7 @@ The AFP Renderer supports some AFP speci
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
-#### Page Overlay (IPO) Extension ## <a id="afp-page-overlay"></a>
+#### Page Overlay (IPO) Extension<a id="afp-page-overlay"></a>
The include-page-overlay extension element allows to define on a per simple-page-master basis a page overlay resource. Example:
@@ -539,7 +548,7 @@ The include-page-overlay extension eleme
The mandatory name attribute must refer to an 8 character (space padded) resource name that must be known in the AFP processing environment. Optional x and y attributes can be specified to place the Overlay at an offset from the top left of the page.
-#### Page Segment (IPS) Extension ## <a id="afp-page-segment"></a>
+#### Page Segment (IPS) Extension<a id="afp-page-segment"></a>
The include-page-segment extension element allows to define resource substitution for fo:external-graphics elements. Example:
@@ -558,7 +567,7 @@ The effect here is that whenever FOP enc
The include-page-segment extension element has the optional attribute *resource-file* . The value of this is a URI to a resource containing a page segment with the declared name. In this case FOP embeds the page segment into the generated document so that the external resource does not have to be supplied in the print job.
-#### Tag Logical Element (TLE) Extension ## <a id="afp-tag-logical-element"></a>
+#### Tag Logical Element (TLE) Extension<a id="afp-tag-logical-element"></a>
The tag-logical-element extension element allows to injects TLEs into the AFP output stream. Example:
@@ -578,7 +587,7 @@ The tag-logical-element extension elemen
The tag-logical-element extension element can appear within a simple-page-master (page level) or it can appear as child of page-sequence (page group level). Multiple tag-logical-element extension elements within a simple-page-master or page-sequence are allowed. The name and value attributes are mandatory.
-#### No Operation (NOP) Extension ## <a id="afp-no-operation"></a>
+#### No Operation (NOP) Extension<a id="afp-no-operation"></a>
The no-operation extension provides the ability to carry up to 32K of comments or any other type of unarchitected data into the AFP output stream. Example:
@@ -592,7 +601,7 @@ The no-operation extension provides the
The no-operation extension element can appear as child of `simple-page-master` (appears after "Begin Page" BPG), `page-sequence` (appears after "Begin Named Page Group" BNG and `declarations` (appears after "Begin Document" BDT). Multiple no-operation extension elements inside the same formatting object are allowed. Each NOP will appear right after the respective "Begin" field indicated above even if it is specified as the last child under its parent. The order inside the parent will be maintained. The "placement" attribute can be used to have the NOP appear before the "End" field of the object rather than after the "Begin" field. Specify `placement="before-end"` to do that. Please note that, at the moment, this only has an effect for NOPs that are children of the `page-sequence` formatting object. The "name" attribute is mandatory but will not appear inside the AFP stream.
-#### Invoke Medium Map (IMM) Extension ## <a id="afp-invoke-medium-map"></a>
+#### Invoke Medium Map (IMM) Extension<a id="afp-invoke-medium-map"></a>
The invoke-medium-map extension allows to generate IMM fields (Invoke Medium Map) in the generated AFP output. Example:
@@ -606,22 +615,22 @@ The invoke-medium-map extension allows t
The invoke-medium-map element is allowed as child of fo:page-sequence (page group level) or fo:simple-page-master. It is NOT supported on document level (fo:root), yet. FOP also doesn't support specifying medium maps inside XML (using BMM/EMM). It can only reference an existing medium map by name. The medium map has to be constructed through different means and available on the target platform.
-#### Form Maps/Defs ## <a id="afp-form-maps"></a>
+#### Form Maps/Defs<a id="afp-form-maps"></a>
Apache FOP supports embedding an external form map resource in the generated AFP output. This is done using the `afp:include-form-map` extension. An example:
-<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
- [..]
- <fo:declarations>
- <afp:include-form-map name="F1SAMP1" src="file:f1samp1.fde"/>
- </fo:declarations>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
+ [..]
+ <fo:declarations>
+ <afp:include-form-map name="F1SAMP1" src="file:f1samp1.fde"/>
+ </fo:declarations>
The `afp:include-form-map` is to be placed as a direct child of `fo:declarations` . The `name` is an AFP resource name (max. 8 characters) and the `src` attribute is the URI identifying the external form map resource. When such a form map is embedded, you can use the `afp:invoke-medium-map` extension (described above) to invoke any medium map included in the form map.
Apache FOP doesn't support a way to define a form map or medium map using XML means inside an XSL-FO document. You will have to build the form map with some third-party tool.
-## Foreign Attributes <a id="afp-foreign-attributes"></a>
+### Foreign Attributes <a id="afp-foreign-attributes"></a>
-#### Resource ## <a id="afp-foreign-attributes-resource"></a>
+#### Resource<a id="afp-foreign-attributes-resource"></a>
The resource foreign attributes provides the ability to name and control where data object resources (e.g. images/scalable vector graphics) will reside in the AFP output. The afp foreign attributes are only used in conjuntion with <fo:external-graphic/> and <instream-foreign-object/>. Example:
@@ -709,14 +718,15 @@ The quality of the bitmap depends on the
### Configuration <a id="bitmap-configuration"></a>
The TIFF and PNG renderer configuration currently allows the following settings:
-<renderer mime="image/png">
- <color-mode>rgba</color-mode>
- <transparent-page-background>true</transparent-page-background>
- <background-color>white</background-color>
- <anti-aliasing>true</anti-aliasing>
- <rendering>quality</rendering>
- <fonts><!-- described elsewhere --></fonts>
-</renderer>
+
+ <renderer mime="image/png">
+ <color-mode>rgba</color-mode>
+ <transparent-page-background>true</transparent-page-background>
+ <background-color>white</background-color>
+ <anti-aliasing>true</anti-aliasing>
+ <rendering>quality</rendering>
+ <fonts><!-- described elsewhere --></fonts>
+ </renderer>
The default value for the `"color-mode"` setting is `"rgba"` which is equivalent to a 24bit RGB image with an 8bit alpha channel for transparency. Valid values are:
@@ -741,11 +751,12 @@ The default value for the `"rendering"`
### TIFF-specific Configuration <a id="tiff-configuration"></a>
In addition to the above values the TIFF renderer configuration allows some additional settings:
-<renderer mime="image/tiff">
- <transparent-page-background>true</transparent-page-background>
- <compression>CCITT T.6</compression>
- <fonts><!-- described elsewhere --></fonts>
-</renderer>
+
+ <renderer mime="image/tiff">
+ <transparent-page-background>true</transparent-page-background>
+ <compression>CCITT T.6</compression>
+ <fonts><!-- described elsewhere --></fonts>
+ </renderer>
The default value for the "compression" setting is "PackBits" which which is a widely supported RLE compression scheme for TIFF. The set of compression names to be used here matches the set that the Image I/O API uses. Note that not all compression schemes may be available during runtime. This depends on the actual codecs being available. Here is a list of possible values:
@@ -767,12 +778,13 @@ The default value for the "compression"
This setting may override any setting made using the `"color-mode"` . For example, if `"CCITT T.6"` is selected, the color mode is automatically forced to `"bi-level"` because this compression format only supports bi-level images.
If you want to use CCITT compression, please make sure you've got [Java Advanced Imaging Image I/O Tools](http://java.sun.com/products/java-media/jai/current.html) in your classpath. The Sun JRE doesn't come with a TIFF codec built in, so it has to be added separately. The internal TIFF codec from XML Graphics Commons only supports PackBits, Deflate and JPEG compression for writing.
-## Runtime Rendering Options <a id="bitmap-rendering-options"></a>
+### Runtime Rendering Options <a id="bitmap-rendering-options"></a>
The IF-based bitmap output implementations support a rendering option with the key "target-bitmap-size" (value: java.awt.Dimension) that allows to force the pages to be proportionally fit into a bitmap of a given size. This can be used to produce thumbnails or little preview images of the individual pages. An example:
-userAgent.getRenderingOptions().put(
- "target-bitmap-size", new Dimension(320, 200));
-# TXT <a id="txt"></a>
+
+ userAgent.getRenderingOptions().put(
+ "target-bitmap-size", new Dimension(320, 200));
+## TXT <a id="txt"></a>
The text renderer produces plain ASCII text output that attempts to match the output of the PDFRenderer as closely as possible. This was originally developed to accommodate an archive system that could only accept plain text files, and is primarily useful for getting a quick-and-dirty view of the document text. The renderer is very limited, so do not be surprised if it gives unsatisfactory results.
Modified: xmlgraphics/site/trunk/content/fop/1.1/pdfa.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/1.1/pdfa.mdtext?rev=1416565&r1=1416564&r2=1416565&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/1.1/pdfa.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/1.1/pdfa.mdtext Mon Dec 3 15:46:33 2012
@@ -53,7 +53,7 @@ There are a number of things that must b
- No filter must be specified explicitely for metadata objects. Metadata must be embedded in clear text so non-PDF-aware applications can extract the XMP metadata.
There are additional requirements if you want to enabled PDF/A-1a (Tagged PDF). This is particularly the specification of the natural language and alternative descriptions for images. Please refer to the [Accessibility page](accessibility.html) for details.
-# PDF profile compatibility <a id="profile-compatibility"></a>
+## PDF profile compatibility <a id="profile-compatibility"></a>
The PDF profiles "PDF/X-3:2003" and "PDF/A-1b" (or "PDF/A-1a") are compatible and can both be activated at the same time.
Modified: xmlgraphics/site/trunk/content/fop/1.1/pdfencryption.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/1.1/pdfencryption.mdtext?rev=1416565&r1=1416564&r2=1416565&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/1.1/pdfencryption.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/1.1/pdfencryption.mdtext Mon Dec 3 15:46:33 2012
@@ -20,6 +20,7 @@ If no owner password has been supplied b
A user password, supplied with the `-u` option, will cause the PDF display software to ask the reader for this password in order to view the contents of the document. If no user password was supplied, viewing the content is not restricted.
Further restrictions can be imposed by using the following command-line options:
+
| Option | Description |
|--------|-------------|
| `-noprint` | disable printing |
@@ -52,15 +53,15 @@ When FOP is embedded in another Java app
Encryption is enabled as soon as one of these options is set.
An example to enable PDF encryption in Java code:
-import org.apache.fop.pdf.PDFEncryptionParams;
-
-[..]
-
-FOUserAgent userAgent = fopFactory.newFOUserAgent();
-useragent.getRendererOptions().put("encryption-params", new PDFEncryptionParams(
- null, "password", false, false, true, true));
-Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent);
-[..]
+ import org.apache.fop.pdf.PDFEncryptionParams;
+
+ [..]
+
+ FOUserAgent userAgent = fopFactory.newFOUserAgent();
+ useragent.getRendererOptions().put("encryption-params", new PDFEncryptionParams(
+ null, "password", false, false, true, true));
+ Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent);
+ [..]
The parameters for the constructor of PDFEncryptionParams are:
Modified: xmlgraphics/site/trunk/content/fop/1.1/running.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/1.1/running.mdtext?rev=1416565&r1=1416564&r2=1416565&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/1.1/running.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/1.1/running.mdtext Mon Dec 3 15:46:33 2012
@@ -54,98 +54,98 @@ Some Mac OSX users have experienced file
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 `/Library/Java/Home` . **Caveat:** 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 [Java on Mac OSX FAQ](http://developer.apple.com/java/faq) for information as it becomes available.
-USAGE
-Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl|-ps|-txt|-at [mime]|-print] <outfile>
- [OPTIONS]
- -version print FOP version and exit
- -d debug mode
- -x dump configuration settings
- -q quiet mode
- -c cfg.xml use additional configuration file cfg.xml
- -l lang the language to use for user information
- -nocs disable complex script features
- -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 run in verbose mode (currently simply print FOP version and continue)
-
- -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
- -nofillinforms PDF file will be encrypted without fill in forms permission
- -noaccesscontent PDF file will be encrypted without extract text and graphics permission
- -noassembledoc PDF file will be encrypted without assemble the document permission
- -noprinthq PDF file will be encrypted without print high quality permission
- -a enables accessibility features (Tagged PDF etc., default off)
- -pdfprofile prof PDF file will be generated with the specified profile
- (Examples for prof: PDF/A-1b or PDF/X-3:2003)
-
- -conserve enable memory-conservation policy (trades memory-consumption for disk I/O)
- (Note: currently only influences whether the area tree is serialized.)
-
- -cache specifies a file/directory path location
- -flush flushes the current font cache file
-
- [INPUT]
- infile xsl:fo input file (the same as the next)
- (use '-' for infile to pipe input from stdin)
- -fo infile xsl:fo input file
- -xml infile xml input file, must be used together with -xsl
- -atin infile area tree input file
- -ifin infile intermediate format input file
- -imagein infile image input file (piping through stdin not supported)
- -xsl stylesheet xslt stylesheet
-
- -param name value <value> to use for parameter <name> in xslt stylesheet
- (repeat '-param name value' for each parameter)
-
- -catalog use catalog resolver for input XML and XSLT files
- [OUTPUT]
- outfile input will be rendered as PDF into outfile
- (use '-' for outfile to pipe output to stdout)
- -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 the AT to be converted
- to final format later
- -if [mime] out representation of document in intermediate format XML (outfile req'd)
- specify optional mime output to allow the IF 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)
- -svg outfile input will be rendered as an SVG slides file (outfile req'd)
- Experimental feature - requires additional fop-sandbox.jar.
-
- -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)
-
-
- [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 -xml - -xsl foo.xsl -pdf -
- fop foo.fo -mif foo.mif
- fop foo.fo -rtf foo.rtf
- fop foo.fo -print
- fop foo.fo -awt
+ USAGE
+ Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl|-ps|-txt|-at [mime]|-print] <outfile>
+ [OPTIONS]
+ -version print FOP version and exit
+ -d debug mode
+ -x dump configuration settings
+ -q quiet mode
+ -c cfg.xml use additional configuration file cfg.xml
+ -l lang the language to use for user information
+ -nocs disable complex script features
+ -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 run in verbose mode (currently simply print FOP version and continue)
+
+ -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
+ -nofillinforms PDF file will be encrypted without fill in forms permission
+ -noaccesscontent PDF file will be encrypted without extract text and graphics permission
+ -noassembledoc PDF file will be encrypted without assemble the document permission
+ -noprinthq PDF file will be encrypted without print high quality permission
+ -a enables accessibility features (Tagged PDF etc., default off)
+ -pdfprofile prof PDF file will be generated with the specified profile
+ (Examples for prof: PDF/A-1b or PDF/X-3:2003)
+
+ -conserve enable memory-conservation policy (trades memory-consumption for disk I/O)
+ (Note: currently only influences whether the area tree is serialized.)
+
+ -cache specifies a file/directory path location
+ -flush flushes the current font cache file
+
+ [INPUT]
+ infile xsl:fo input file (the same as the next)
+ (use '-' for infile to pipe input from stdin)
+ -fo infile xsl:fo input file
+ -xml infile xml input file, must be used together with -xsl
+ -atin infile area tree input file
+ -ifin infile intermediate format input file
+ -imagein infile image input file (piping through stdin not supported)
+ -xsl stylesheet xslt stylesheet
+
+ -param name value <value> to use for parameter <name> in xslt stylesheet
+ (repeat '-param name value' for each parameter)
+
+ -catalog use catalog resolver for input XML and XSLT files
+ [OUTPUT]
+ outfile input will be rendered as PDF into outfile
+ (use '-' for outfile to pipe output to stdout)
+ -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 the AT to be converted
+ to final format later
+ -if [mime] out representation of document in intermediate format XML (outfile req'd)
+ specify optional mime output to allow the IF 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)
+ -svg outfile input will be rendered as an SVG slides file (outfile req'd)
+ Experimental feature - requires additional fop-sandbox.jar.
+
+ -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)
+
+
+ [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 -xml - -xsl foo.xsl -pdf -
+ fop foo.fo -mif foo.mif
+ fop foo.fo -rtf foo.rtf
+ fop foo.fo -print
+ fop foo.fo -awt
PDF encryption is only available if FOP was compiled with encryption support **and** if compatible encryption support is available at run time. Currently, only the JCE is supported. Check the [Details](pdfencryption.html) .
### Writing your own script <a id="your-own-script"></a>
Modified: xmlgraphics/site/trunk/content/fop/1.1/servlets.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/1.1/servlets.mdtext?rev=1416565&r1=1416564&r2=1416565&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/1.1/servlets.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/1.1/servlets.mdtext Mon Dec 3 15:46:33 2012
@@ -22,38 +22,42 @@ The servlet is automatically built when
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.
-# Create your own Servlet <a id="servlet"></a>
+## Create your own Servlet <a id="servlet"></a>
This section assumes you are familiar with [embedding FOP](embedding.html) .
-## A minimal Servlet <a id="minimal-servlet"></a>
+### A minimal Servlet <a id="minimal-servlet"></a>
Here is a minimal code snippet to demonstrate the basics:
-private FopFactory fopFactory = FopFactory.newInstance();
-private TransformerFactory tFactory = TransformerFactory.newInstance();
-
-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);
+
+ private FopFactory fopFactory = FopFactory.newInstance();
+ private TransformerFactory tFactory = TransformerFactory.newInstance();
+
+ 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.
-## Adding XSL tranformation (XSLT) <a id="xslt"></a>
+There are numerous problems with the code snippet above. Its purpose is only to demonstrate the basic concepts. See below for details.
-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();
+### Adding XSL tranformation (XSLT) <a id="xslt"></a>
-public void init() throws ServletException {
- //Optionally customize the FopFactory and TransformerFactory here
-}
+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();
+
+ public void init() throws ServletException {
+ //Optionally customize the FopFactory and TransformerFactory here
+ }
+
+ [..]
//Setup a buffer to obtain the content length
ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -127,24 +131,24 @@ Further down, you can use the URIResolve
Here are some example snippets:
-//Setting up the JAXP TransformerFactory
-this.transFactory = TransformerFactory.newInstance();
-this.transFactory.setURIResolver(this.uriResolver);
-
-[..]
-
-//Setting up the FOP factory
-this.fopFactory = FopFactory.newInstance();
-this.fopFactory.setURIResolver(this.uriResolver);
-
-[..]
-
-//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);
-# Notes on Microsoft Internet Explorer <a id="ie"></a>
+ //Setting up the JAXP TransformerFactory
+ this.transFactory = TransformerFactory.newInstance();
+ this.transFactory.setURIResolver(this.uriResolver);
+
+ [..]
+
+ //Setting up the FOP factory
+ this.fopFactory = FopFactory.newInstance();
+ this.fopFactory.setURIResolver(this.uriResolver);
+
+ [..]
+
+ //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);
+## Notes on Microsoft Internet Explorer <a id="ie"></a>
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:
Modified: xmlgraphics/site/trunk/content/fop/trunk/configuration.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/trunk/configuration.mdtext?rev=1416565&r1=1416564&r2=1416565&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/trunk/configuration.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/trunk/configuration.mdtext Mon Dec 3 15:46:33 2012
@@ -86,6 +86,7 @@ Apache FOP uses the image loading framew
</image-loading>
<renderers....
</fop>
+
The first penalty element increases the penalty for the raw CCITT loader. This practically forces the decoding of CCITT compressed TIFF images except if there are no TIFF codecs available.
The second penalty element sets an "infinite" penalty for the TIFF loader using the internal TIFF codec. This practically disables that plug-in as it will never be chosen as a possible solution.
@@ -118,6 +119,7 @@ The configuration for the PDF Renderer c
<renderer mime="application/postscript">
<!-- etc. etc..... -->
+
The details on the font configuration can be found on the separate [Fonts](fonts.html) page. Note especially the section entitled [Register Fonts with FOP](fonts.html#register) .
### Special Settings for the PDF Renderer <a id="pdf-renderer"></a>
@@ -135,6 +137,7 @@ The configuration element for the PDF re
<fonts....
</renderer>
+
Another (optional) setting specific to the PDF Renderer is an output color profile, an ICC color profile which indicates the target color space the PDF file is generated for. This setting is mainly used in conjunction with the [PDF/X](pdfx.html) feature. An example:
<renderer mime="application/pdf">
@@ -143,7 +146,8 @@ Another (optional) setting specific to t
<output-profile>C:\FOP\Color\EuropeISOCoatedFOGRA27.icc</output-profile>
<fonts....
- </renderer>
+ </renderer>
+
Some people don't have high requirements on color fidelity but instead want the smallest PDF file sizes possible. In this case it's possible to disable the default sRGB color space which XSL-FO requires. This will cause RGB colors to be generated as device-specific RGB. Please note that this option is unavailable (and will cause an error) if you enable PDF/A or PDF/X functionality or if you specify an output profile. This setting will make the PDF about 4KB smaller. To disable the sRGB color space add the following setting:
<renderer mime="application/pdf">
@@ -152,7 +156,8 @@ Some people don't have high requirements
<disable-srgb-colorspace>true</disable-srgb-colorspace>
<fonts....
- </renderer>
+ </renderer>
+
FOP supports encryption of PDF output, thanks to Patrick C. Lankswert. This feature is commonly used to prevent unauthorized viewing, printing, editing, copying text from the document and doing annotations. It is also possible to ask the user for a password in order to view the contents. Note that there already exist third party applications which can decrypt an encrypted PDF without effort and allow the aforementioned operations, therefore the degree of protection is limited. For further information about features and restrictions regarding PDF encryption, look at the documentation coming with Adobe Acrobat or the technical documentation on the Adobe web site.
<renderer mime="application/pdf">
@@ -170,6 +175,7 @@ FOP supports encryption of PDF output, t
<noprinthq/>
</encryption-params>
</renderer>
+
By default FOP produces PDF files of version 1.4, but this can be changed in order to benefit from features that appeared in newer versions of PDF. At the moment, only a few features from PDF 1.5 have been implemented, but the configuration element will accept any value between 1.4 and 1.7. This is the value that will appear in the PDF header, although only features up to 1.5 will actually be used.
<renderer mime="application/pdf">
@@ -205,6 +211,7 @@ Additionally, there are certain settings
<rendering>quality</rendering>
<text-rendering>bitmap</text-rendering>
</renderer>
+
The default value for the "rendering" setting is "speed" which causes borders to be painted as plain rectangles. In this mode, no special borders (dotted, dashed etc.) are available. If you want support for all border modes, set the value to "quality" as indicated above. This will cause the borders to be painted as bitmaps.
The default value for the "text-rendering" setting is "auto" which paints the base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D. If the mix of painting methods results in unwelcome output, you can set this to "bitmap" which causes all text to be rendered as bitmaps.
@@ -222,6 +229,7 @@ Additionally, there are certain settings
<!-- a default external resource group file -->
<resource-group-file>resources.afp</resource-group-file>
</renderer>
+
The default value for the images "mode" setting is "b+w" (black and white). When the images "mode" setting is "b+w" a "bits-per-pixel" setting can be provided to aid the grayscale conversion process. With this setting all images referenced in your source document are converted to an IOCA FS45 grayscale bitmap image form. When the setting is "color" all images are converted to an IOCA FS45 color bitmap image form. When "native" setting is "true", all images encountered (TIFF, GIF, JPEG and Encapsulated Postscript etc.) will be embedded directly in the datastream in their native form using a MO:DCA Object Container.
The default value for the "renderer-resolution" is 240 dpi.
@@ -237,10 +245,13 @@ Check the following possibilities:
- The format of the configuration file has changed considerably between FOP 0.20.5 and FOP 1.0 and its beta versions. Did you convert your file to the new format?
-- The FOP distribution contains a schema for configuration files, at src/foschema/fop-configuration.xsd. Did you validate your configuration file against it? Add the following schema location to the `schema` element:<fop
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-xsi:noNamespaceSchemaLocation=
-"http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/foschema/fop-configuration.xsd?view=co">
+- The FOP distribution contains a schema for configuration files, at src/foschema/fop-configuration.xsd. Did you validate your configuration file against it? Add the following schema location to the `schema` element:
+
+ <fop
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation=
+ "http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/foschema/fop-configuration.xsd?view=co">
+
and run the configuration file through a validating schema parser. Note that the schema cannot detect all errors, and that it is stricter about the order of some elements than FOP itself is.
- Run FOP in debug mode (command line option `-d` ). This makes FOP report which configuration information it finds. Check if FOP finds what you expect.
Modified: xmlgraphics/site/trunk/content/fop/trunk/embedding.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/trunk/embedding.mdtext?rev=1416565&r1=1416564&r2=1416565&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/trunk/embedding.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/trunk/embedding.mdtext Mon Dec 3 15:46:33 2012
@@ -39,35 +39,35 @@ Here is the basic pattern to render an X
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.MimeConstants;
-
+
/*..*/
-
+
// Step 1: Construct a FopFactory
// (reuse if you plan to render multiple documents!)
FopFactory fopFactory = FopFactory.newInstance();
-
+
// Step 2: Set up output stream.
// Note: Using BufferedOutputStream for performance reasons (helpful with FileOutputStreams).
OutputStream out = new BufferedOutputStream(new FileOutputStream(new File("C:/Temp/myfile.pdf")));
-
+
try {
// Step 3: Construct fop with desired output format
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);
-
+
// Step 4: Setup JAXP using identity transformer
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); // identity transformer
-
+
// Step 5: Setup input and output for XSLT transformation
// Setup input stream
Source src = new StreamSource(new File("C:/Temp/myfile.fo"));
-
+
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
-
+
// Step 6: Start XSLT transformation and FOP processing
transformer.transform(src, res);
-
+
} finally {
//Clean-up
out.close();
@@ -116,7 +116,7 @@ If you want to process XSL-FO generated
//without XSLT:
//Transformer transformer = factory.newTransformer(); // identity transformer
-
+
//with XSLT:
Source xslt = new StreamSource(new File("mystylesheet.xsl"));
Transformer transformer = factory.newTransformer(xslt);
@@ -127,17 +127,17 @@ 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:** `Source src = new StreamSource("http://localhost:8080/testfile.xml");`
-- **File:** `Source src = new StreamSource(new File("C:/Temp/myinputfile.xml"));`
+- **File:** `Source src = new StreamSource(new File("C:/Temp/myinputfile.xml"));`
-- **String:** `Source src = new StreamSource(new StringReader(myString)); // myString is a String`
+- **String:** `Source src = new StreamSource(new StringReader(myString)); // myString is a String`
-- **InputStream:** `Source src = new StreamSource(new MyInputStream(something));`
+- **InputStream:** `Source src = new StreamSource(new MyInputStream(something));`
-- **Byte Array:** `Source src = new StreamSource(new ByteArrayInputStream(myBuffer)); // myBuffer is a byte[] here`
+- **Byte Array:** `Source src = new StreamSource(new ByteArrayInputStream(myBuffer)); // myBuffer is a byte[] here`
-- **DOM:** `Source src = new DOMSource(myDocument); // myDocument is a Document or a Node`
+- **DOM:** `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.
@@ -154,42 +154,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:
`fopFactory.getFontManager().setFontBaseURL("file:///C:/Temp/fonts");`
--
+-
The **hyphenation base URL** to use when resolving relative URLs for hyphenation patterns. Example:
`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:
`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:
`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:
`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:
- `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:
- `fopFactory.setURIResolver(myResolver);//myResolver is a javax.xml.transform.URIResolverBoth`
-
- 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.
+ `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 <a id="user-agent"></a>
@@ -203,61 +202,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:
`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:
`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:
`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:
`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:
`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:
`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:
`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:
`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.
`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:
`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:
- `userAgent.setURIResolver(myResolver); // myResolver is a javax.xml.transform.URIResolverBoth 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.
+ `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 <a id="config-external"></a>
@@ -265,15 +264,15 @@ Instead of setting the parameters manual
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
-
+
/*..*/
-
+
DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
Configuration cfg = cfgBuilder.buildFromFile(new File("C:/Temp/mycfg.xml"));
fopFactory.setUserConfig(cfg);
-
+
/* ..or.. */
-
+
fopFactory.setUserConfig(new File("C:/Temp/mycfg.xml"));
The layout of the configuration file is described on the [Configuration page](configuration.html) .
@@ -282,11 +281,11 @@ The layout of the configuration file is
The document handlers are classes that inherit from `org.apache.fop.render.intermediate.IFDocumentHandler` . This is an interface for which a MIME type specific implementation can be created. This same handler is used either when XSL-FO is used as the input or when Intermediate Format is used. Since IF is output format agnostic, if custom fonts or other configuration information that affect layout (specific to a particular MIME type) are given then FOP needs that contextual information. The document handler provides that context so that when the IF is rendered, it is more visually consistent with FO rendering. The code below shows an example of how a document handler can be used to provide PDF configuration data to the IFSerializer.
IFDocumentHandler targetHandler = userAgent.getRendererFactory().createDocumentHandler(userAgent, MimeConstants.MIME_PDF);
-
+
IFSerializer ifSerializer = new IFSerializer(); //Create the IFSerializer to write the intermediate format
ifSerializer.setContext(new IFContext(userAgent));
ifSerializer.mimicDocumentHandler(targetHandler); //Tell the IFSerializer to mimic the target format
-
+
userAgent.setDocumentHandlerOverride(ifSerializer); //Make sure the prepared document handler is used
The rest of the code is the same as in [Basic Usage Patterns](#basics) .
Modified: xmlgraphics/site/trunk/content/fop/trunk/extensions.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/trunk/extensions.mdtext?rev=1416565&r1=1416564&r2=1416565&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/trunk/extensions.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/trunk/extensions.mdtext Mon Dec 3 15:46:33 2012
@@ -3,7 +3,6 @@ Title: Standard Apache™ FOP Extens
#Standard Apache™ FOP Extensions
-
By "extension", we mean any data that can be placed in the input XML document that is not addressed by the XSL-FO standard. By having a mechanism for supporting extensions, Apache™ FOP is able to add features that are not covered in the specification.
The extensions documented here are included with FOP, and are automatically available to you. If you wish to add an extension of your own to FOP, please see the [Developers' Extension Page](../dev/extensions.html).
@@ -26,7 +25,7 @@ In old versions of Apache FOP there was
### Anchors or Named Destinations <a id="named-destinations"></a>
-Use the fox:destination element to define "named destinations"inside a PDF document. These are useful as fragment identifiers, e.g. "http://server/document.pdf#anchor-name". fox:destination elements can be placed almost anywhere in the fo document, including a child of root, a block-level element, or an inline-level element. For the destination to actually work, it must correspond to an "id" attribute on some fo element within the document. In other words, the "id" attribute actually creates the "view" within the PDF document. The fox:destination simply gives that view an independent name.
+Use the fox:destination element to define "named destinations" inside a PDF document. These are useful as fragment identifiers, e.g. "http://server/document.pdf#anchor-name". fox:destination elements can be placed almost anywhere in the fo document, including a child of root, a block-level element, or an inline-level element. For the destination to actually work, it must correspond to an "id" attribute on some fo element within the document. In other words, the "id" attribute actually creates the "view" within the PDF document. The fox:destination simply gives that view an independent name.
<fox:destination internal-destination="table-of-contents"/>
...
@@ -192,4 +191,4 @@ Applies to: fo:simple-page-master
The crop box controls how Acrobat displays the page (CropBox in PDF) or how the Java2DRenderer sizes the output media. The PDF specification defines that the CropBox defaults to the MediaBox. This extension follows that definition. To simplify usage and cover most use cases, the three supported enumeration values "trim-box", "bleed-box" and "media-box" set the CropBox to one of those three other boxes.
-If requested in the future, we could offer to specify the CropBox in absolute coordinates rather than just by referencing another box.
\ No newline at end of file
+If requested in the future, we could offer to specify the CropBox in absolute coordinates rather than just by referencing another box.
Modified: xmlgraphics/site/trunk/content/fop/trunk/output.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/trunk/output.mdtext?rev=1416565&r1=1416564&r2=1416565&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/trunk/output.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/trunk/output.mdtext Mon Dec 3 15:46:33 2012
@@ -306,6 +306,7 @@ There are still a big number of older (o
#### Fonts<a id="afp-font-config"></a>
The AFP Renderer requires special configuration particularly related to fonts. AFP Render configuration is done through the normal FOP configuration file. The MIME type for the AFP Renderer is application/x-afp which means the AFP Renderer section in the FOP configuration file looks like:
+
<renderer mime="application/x-afp">
<!-- AFP Renderer -->
...
Modified: xmlgraphics/site/trunk/content/fop/trunk/servlets.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/trunk/servlets.mdtext?rev=1416565&r1=1416564&r2=1416565&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/trunk/servlets.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/trunk/servlets.mdtext Mon Dec 3 15:46:33 2012
@@ -57,7 +57,7 @@ A common requirement is to transform an
//Optionally customize the FopFactory and TransformerFactory here
}
-[..]
+ [..]
//Setup a buffer to obtain the content length
ByteArrayOutputStream out = new ByteArrayOutputStream();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org