Added: websites/staging/xmlgraphics/trunk/content/fop/2.3/output.html ============================================================================== --- websites/staging/xmlgraphics/trunk/content/fop/2.3/output.html (added) +++ websites/staging/xmlgraphics/trunk/content/fop/2.3/output.html Wed May 16 10:04:56 2018 @@ -0,0 +1,1416 @@ + + + + Apache(tm) FOP Output Formats + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ The Apache FOP Project +

The Apache™ FOP Project

+
+ + + +
+
+
+ +
+

Apache™ FOP Output Formats

+

Apache™ FOP supports multiple output formats by using a different renderer for each format. The renderers do not all have the same set of capabilities, sometimes because of the output format itself, sometimes because some renderers get more development attention than others.

+

General Information

+

Fonts

+

Most FOP renderers use a FOP-specific system for font registration. However, the Java2D/AWT and print renderers use the Java AWT package, which gets its font information from the operating system registration. This can result in several differences, including actually using different fonts, and having different font metrics for the same font. The net effect is that the layout of a given FO document can be quite different between renderers that do not use the same font information.

+

Theoretically, there's some potential to make the output of the PDF/PS renderers match the output of the Java2D-based renderers. If FOP used the font metrics from its own font subsystem but still used Java2D for text painting in the Java2D-based renderers, this could probably be achieved. However, this approach hasn't been implemented, yet.

+

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. 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
    • +
    +

    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.

    +
  2. +
  3. +

    Render to a PDF file:

    +
      +
    • fop -atin myfile.at.xml -pdf myfile.pdf
    • +
    +
  4. +
  5. +

    Render to a Java2D-based renderer:

    +
      +
    • +

      fop -atin myfile.at.xml -print

      +
    • +
    • +

      fop -atin myfile.at.xml -awt

      +
    • +
    • +

      fop -atin myfile.at.xml -tiff myfile.tiff

      +
    • +
    +
  6. +
+

Output to a Printer or Other Device

+

The most obvious way to print your document is to use the FOP print renderer, 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\printer

+

fop ... -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();
+
+ + +

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 is the best supported output format. It is also the most accurate with text and layout. This creates a PDF document that is streamed out as each page is rendered. This means that the internal page index information is stored near the end of the document. The PDF version supported is 1.4. PDF versions are forwards/backwards compatible.

+

Note that FOP does not currently support PDF/A-1a. Support for Tagged PDF, PDF/A-1b and PDF/X has recently been added, however.

+

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."

+

Post-processing

+

FOP does not currently support several desirable PDF features: watermarks and signatures. One workaround is to use Adobe Acrobat (the full version, not the Reader) to process the file manually or with scripting that it supports.

+

Another popular post-processing tool is iText, which has tools for adding security features, document properties, watermarks, and many other features to PDF files. +Caveat: iText may swallow PDF bookmarks. But Jens Stavnstrup tells us in issue FOP-1100 that this doesn't happen if you use iText's PDFStamper. +Here is some sample code that uses iText to encrypt a FOP-generated PDF. (Note that FOP now supports PDF encryption. 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(new File(".").toURI());
+        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();
+    }
+}
+
+ + +

Check the iText tutorial and documentation for setting access flags, password, encryption strength and other parameters.

+

Watermarks

+

In addition to the PDF Post-processing options, consider the following workarounds:

+ +

Extensions

+

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">
+
+ + +

Embedded Files

+

It is possible to attach/embed arbitrary files into a PDF file. You can give a name and a description of the file. Example:

+
<fo:declarations>
+  <pdf:embedded-file filename="image.jpg" src="url(file:///C:/Temp/myimage.jpg)" description="My image"/>
+  <pdf:embedded-file src="url(file:///C:/Temp/MyTextDoc.odt)"/>
+</fo:declarations>
+
+ + +

pdf:embedded-file must be a child of fo:declarations. The "src" property is used to reference the file that is to be embedded. This property uses the "uri-specification" datatype from the XSL-FO specification. The "filename" property is optional. If it is missing the filename is automatically set from the URI/IRI of the "src" property. An optional description can also be added to further describe the file attachment.

+

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>
+
+ + +

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.

+

Custom Document Properties

+

In Adobe Reader (and possibly other PDF viewers), in the Document Properties window, +there is a tab that shows custom properties that have been set on the document:
+PDF Custom Document Properties

+

Such properties are stored in the PDF in the form of additional key/value pairs in the +Document Information Dictionary (the Info dictionary). They can be set in the +FO document using the pdf:info extension element as a child of fo:declarations:

+
<fo:declarations>
+  <pdf:info xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
+    <pdf:name key="MyCustomProperty">MyPropertyValue</pdf:name>
+  </pdf:info>
+</fo:declarations>
+
+ + +

Each custom property must be specified using the pdf:name element. Remember that the property name must be different to the reserved keywords, which are Title, Author, Subject, Keywords, Creator, Producer, CreationDate, ModDate and Trapped.

+

PDF Linearization

+

Linearization is helpful to allow viewing of a pdf over a slow connection. Needs to be enabled using fop.xconf:

+
<fop version="1.0">
+  <renderers>
+    <renderer mime="application/pdf">
+      <linearization>true</linearization>
+    </renderer>
+  </renderers>
+</fop>
+
+ + +

PostScript

+

The PostScript renderer has been brought up to a similar quality as the PDF renderer, but may still be missing certain features. Currently, the PostScript renderer generates PostScript Level 3 with most DSC comments. Actually, the only Level 3 features used are the FlateDecode and DCTDecode filter (the latter is used for 1:1 embedding of JPEG images), everything else is Level 2.

+

Configuration

+

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>
+  <acrobat-downsample>true</acrobat-downsample>
+</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.

+

The default value for the "optimize-resources" setting is "false". Setting it to "true" will produce the PostScript file in two steps. A temporary file will be written first which will then be processed to add only the fonts which were really used and images are added to the stream only once as PostScript forms. This will reduce file size but can potentially increase the memory needed in the interpreter to process.

+

The default value for the "safe-set-page-device" setting is "false". Setting it to "true" will cause the renderer to invoke a postscript macro which guards against the possibility of invalid/unsupported postscript key/values being issued to the implementing postscript page device.

+

The default value for the "dsc-compliant" setting is "true". Setting it to "false" will break DSC compliance by minimizing the number of setpagedevice calls in the postscript document output. This feature may be useful when unwanted blank pages are experienced in your postscript output. This problem is caused by the particular postscript implementation issuing unwanted postscript subsystem initgraphics/erasepage calls on each setpagedevice call.

+

The default value for the "rendering" setting is "quality". Setting it to "size" optimizes rendering for smaller file sizes which can involve minor compromises in rendering quality. For example, solid borders are then painted as plain rectangles instead of the elaborate painting instructions required for mixed-color borders.

+

The default value for the "acrobat-downsample" setting is "false". Setting it to "true" can involve minor compromises in rendering quality to allow compatibility with Adobe Acrobat.

+

Limitations

+ +

PCL

+

This format is for the Hewlett-Packard PCL printers and other printers supporting PCL. It should produce output as close to identical as possible to the printed output of the PDFRenderer within the limitations of the renderer, and output device.

+

The output created by the PCLRenderer is generic PCL 5, HP GL/2 and PJL. This should allow any device fully supporting PCL 5 to be able to print the output generated by the PCLRenderer. PJL is used to control the print job and switch to the PCL language. PCL 5 is used for text, raster graphics and rectangular fill graphics. HP GL/2 is used for more complex painting operations. Certain painting operations are done off-screen and rendered to PCL as bitmaps because of limitations in PCL 5.

+

Truetype fonts can be embedded, other font formats will be rendered as bitmaps.

+

References

+ +

Limitations

+ +

Configuration

+

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>
+  <images mode="color"/>
+</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.

+

The default value for the "disable-pjl" setting is "false". This means that the PCL renderer usually generates PJL commands before and after the document in order to switch a printer into PCL language. PJL commands can be disabled if you set this value to "true".

+

The default value for "image" mode is monochrome output, use "mode" equals "color" to enable color output.

+

You can control the output resolution for the PCL using the "target resolution" setting on the FOUserAgent. The actual value will be rounded up to the next supported PCL resolution. Currently, only 300 and 600 dpi are supported which should be enough for most use cases. Note that this setting directly affects the size of the output file and the print quality.

+

Extensions

+

The PCL Renderer supports some PCL 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:pcl="http://xmlgraphics.apache.org/fop/extensions/pcl">
+
+ + +

Page Source (Tray selection)

+

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:

+
<fo:layout-master-set>
+  <fo:simple-page-master master-name="simple" pcl:paper-source="2">
+    ...
+  </fo:simple-page-master>
+</fo:layout-master-set>
+
+ + +

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

+

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:

+
<fo:layout-master-set>
+  <fo:simple-page-master master-name="simple" pcl:output-bin="2">
+    ...
+  </fo:simple-page-master>
+</fo:layout-master-set>
+
+ + +

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

+

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:

+
<fo:layout-master-set>
+  <fo:simple-page-master master-name="simple" pcl:duplex-mode="0">
+    ...
+  </fo:simple-page-master>
+</fo:layout-master-set>
+
+ + +

Note: the duplex is a positive integer and the value depends on the target printer. Not all PCL printers support duplexing. Usually, "0" is simplex, "1" is duplex (long-edge binding), "2" is duplex (short-edge binding). Consult the technical reference for your printer for all available values.

+

AFP

+

The FOP AFP Renderer deals with creating documents conforming to the IBM AFP document architecture also refered to as MO:DCA (Mixed Object Document Content Architecture).

+

The mapping of XSL-FO elements to the major MO:DCA structures is as follows:

+ + + + + + + + + + + + + + + + + + + + + +
XSL-FO elementMO:DCA-P object
fo:rootDocument
fo:page-sequencePage Group
fo:simple-page-masterPage
+

FOP creates exactly one Document per Printfile with an optional Resource Group at the beginning. FOP does not create document indices.

+

References

+ +

Limitations

+

This list is most likely badly incomplete.

+ +

Deployment in older environments

+

There are still a big number of older (or limited) MO:DCA/IPDS environments in production out there. AFP has grown in functionality over time and not every environment supports the latest features. We're trying to make AFP output work in as many environments as possible. However, to make AFP output work on older environments it is recommended to set to configuration to 1 bit per pixel (see below on how to do this). In this case, all images are converted to bi-level images using IOCA function set 10 (FS10) and are enclosed in page-segments since some implementation cannot deal with IOCA objects directly. If a higher number of bits per pixel is configured, FOP has to switch to at least FS11 which may not work everywhere.

+

Configuration

+

Fonts

+

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>
+
+ + +

There are 5 font configuration variants supported:

+
    +
  1. +

    TrueType fonts

    +
  2. +
  3. +

    IBM Raster fonts

    +
  4. +
  5. +

    IBM Outline fonts

    +
  6. +
  7. +

    IBM CID-keyed (Type 0) fonts

    +
  8. +
  9. +

    FOP built-in Base14 fonts

    +
  10. +
+

TrueType font configuration looks like:

+
<font kerning="yes" embed-url="fonts/Uvb_____.TTF" name="Univers">
+    <font-triplet name="Univers" style="normal" weight="normal"/>
+    <font-triplet name="any" style="normal" weight="normal"/>
+</font>
+
+ + +

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.

+
<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>
+
+ + +

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>
+
+<!-- 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. 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

+

By default the AFP Renderer creates output with a resolution of 240 dpi. This can be overridden by the configuration element. Example:

+
<renderer-resolution>240</renderer-resolution>
+
+ + +

Images

+

By default the AFP Renderer converts all images to 8 bit grey level. This can be overridden by the configuration element. Example:

+
<images mode="color" />
+
+ + +

This will put images as RGB images into the AFP output stream. The default setting is:

+
<images mode="b+w" bits-per-pixel="8" native="true"/>
+
+ + +

Only the values "color" and "b+w" are allowed for the mode attribute.

+

The bits-per-pixel attribute is ignored if mode is "color". For "b+w" mode is must be 1, 4, or 8.

+
<images native="true"/>
+
+ + +

When the native attribute is specified and set to "true", all image resources will be natively injected into the datastream using an object container rather than being converted into an IOCA FS45 image. Support for native image formats (e.g. JPEG, TIFF, GIF) is not always available on printer implementations so by default this configuration option is set to "false".

+

Setting cmyk="true" on the images element will enable CMYK colors. This will only have an effect if the color mode is set to "color". Example:

+
<images mode="color" cmyk="true"/>
+
+ + +

When the color mode is set to 1 bit (bi-level), the "dithering-quality" attribute can be used to select the level of quality to use when converting images to bi-level images. Valid values for this attribute are floating point numbers from 0.0 (fastest) to 1.0 (best), or special values: "minimum" (=0.0), "maximum" (1.0), "medium" (0.5, the default). For the higher settings to work as expected, JAI needs to be present in the classpath. If JAI is present, 0.0 results in a minimal darkness-level switching between white and black. 0.5 does bayer-based dithering and 1.0 will use error-diffusion dithering. The higher the value, the higher the quality and the slower the processing of the images.

+
<images mode="b+w" bits-per-pixel="1" dithering-quality="maximum"/>
+
+ + +

When the boolean attribute pseg (default false) is set to true, non-inline FS11 and FS45 IOCA images are wrapped in page segment. This option is provided to support printers/print servers that require this MO:DCA structure.

[... 364 lines stripped ...] --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: commits-help@xmlgraphics.apache.org