Class PageExtractor
java.lang.Object
org.apache.xmlgraphics.ps.dsc.tools.PageExtractor
- All Implemented Interfaces:
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
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
extractPages
(InputStream in, 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.
-
Method Details
-
extractPages
public static void extractPages(InputStream in, OutputStream out, int from, int to) throws 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 fromout
- the OutputStream to write the modified file tofrom
- the starting page (1-based)to
- the last page (inclusive, 1-based)- Throws:
IOException
- In case of an I/O errorDSCException
- In case of a violation of the DSC spec
-