xmlgraphics-commons 1.4

org.apache.xmlgraphics.ps.dsc.tools
Class PageExtractor

java.lang.Object
  extended by org.apache.xmlgraphics.ps.dsc.tools.PageExtractor
All Implemented Interfaces:
DSCParserConstants

public class PageExtractor
extends java.lang.Object
implements DSCParserConstants

This class can extract a certain range of pages from a DSC-compliant PostScript file.


Field Summary
 
Fields inherited from interface org.apache.xmlgraphics.ps.dsc.DSCParserConstants
COMMENT, DSC_COMMENT, EOF, HEADER_COMMENT, LINE
 
Constructor Summary
PageExtractor()
           
 
Method Summary
static void extractPages(java.io.InputStream in, java.io.OutputStream out, int from, int to)
          Parses a DSC-compliant file and pipes the content through to the OutputStream omitting all pages not within the range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageExtractor

public PageExtractor()
Method Detail

extractPages

public static void extractPages(java.io.InputStream in,
                                java.io.OutputStream out,
                                int from,
                                int to)
                         throws java.io.IOException,
                                DSCException
Parses a DSC-compliant file and pipes the content through to the OutputStream omitting all pages not within the range.

Parameters:
in - the InputStream to parse from
out - the OutputStream to write the modified file to
from - the starting page (1-based)
to - the last page (inclusive, 1-based)
Throws:
java.io.IOException - In case of an I/O error
DSCException - In case of a violation of the DSC spec

xmlgraphics-commons 1.4

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