org.apache.fop.render.ps

Class ResourceHandler

Implemented Interfaces:
DSCParserConstants, PSSupportedFlavors

public class ResourceHandler
extends java.lang.Object
implements DSCParserConstants, PSSupportedFlavors

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.

Fields inherited from interface org.apache.fop.render.ps.PSSupportedFlavors

LEVEL_2_FLAVORS_FORM, LEVEL_2_FLAVORS_INLINE, LEVEL_3_FLAVORS_FORM, LEVEL_3_FLAVORS_INLINE

Method Summary

static void
process(FOUserAgent userAgent, InputStream in, OutputStream out, FontInfo fontInfo, ResourceTracker resTracker, Map formResources, int pageCount, Rectangle2D documentBoundingBox)
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,
                           Rectangle2D documentBoundingBox)
            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)")
documentBoundingBox - the document's bounding box (given here because PSRenderer writes an "(atend)")

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