fop 0.94

org.apache.fop.render.ps
Class ResourceHandler

java.lang.Object
  extended by org.apache.fop.render.ps.ResourceHandler
All Implemented Interfaces:
org.apache.xmlgraphics.ps.dsc.DSCParserConstants

public class ResourceHandler
extends java.lang.Object
implements org.apache.xmlgraphics.ps.dsc.DSCParserConstants

This class is used when two-pass production is used to generate the PostScript file (setting "optimize-resources"). It uses the DSC parser from XML Graphics Commons to go over the temporary file generated by the PSRenderer and adds all used fonts and images as resources to the PostScript file.


Field Summary
 
Fields inherited from interface org.apache.xmlgraphics.ps.dsc.DSCParserConstants
COMMENT, DSC_COMMENT, EOF, HEADER_COMMENT, LINE
 
Constructor Summary
ResourceHandler()
           
 
Method Summary
static void process(FOUserAgent userAgent, java.io.InputStream in, java.io.OutputStream out, FontInfo fontInfo, org.apache.xmlgraphics.ps.dsc.ResourceTracker resTracker, java.util.Map formResources, int pageCount)
          Rewrites the temporary PostScript file generated by PSRenderer adding all needed resources (fonts and images).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceHandler

public ResourceHandler()
Method Detail

process

public static void process(FOUserAgent userAgent,
                           java.io.InputStream in,
                           java.io.OutputStream out,
                           FontInfo fontInfo,
                           org.apache.xmlgraphics.ps.dsc.ResourceTracker resTracker,
                           java.util.Map formResources,
                           int pageCount)
                    throws org.apache.xmlgraphics.ps.dsc.DSCException,
                           java.io.IOException
Rewrites the temporary PostScript file generated by PSRenderer adding all needed resources (fonts and images).

Parameters:
userAgent - the FO user agent
in - the InputStream for the temporary PostScript file
out - the OutputStream to write the finished file to
fontInfo - the font information
resTracker - the resource tracker to use
formResources - Contains all forms used by this document (maintained by PSRenderer)
pageCount - the number of pages (given here because PSRenderer writes an "(atend)")
Throws:
org.apache.xmlgraphics.ps.dsc.DSCException - If there's an error in the DSC structure of the PS file
java.io.IOException - In case of an I/O error

fop 0.94

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.