org.apache.fop.render.ps

Class ResourceHandler

Implemented Interfaces:
DSCParserConstants

public class ResourceHandler
extends java.lang.Object
implements 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.

Method Summary

static void
process(FOUserAgent userAgent, InputStream in, OutputStream out, FontInfo fontInfo, ResourceTracker resTracker, Map formResources, int pageCount)
Rewrites the temporary PostScript file generated by PSRenderer adding all needed resources (fonts and images).

Method Details

process

public static void process(FOUserAgent userAgent,
                           InputStream in,
                           OutputStream out,
                           FontInfo fontInfo,
                           ResourceTracker resTracker,
                           Map formResources,
                           int pageCount)
            throws DSCException,
                   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)")

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