Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| xmlgraphics-commons 1.5
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xmlgraphics.ps.dsc.tools
Class DSCTools

    java.lang.Object
      org.apache.xmlgraphics.ps.dsc.tools.DSCTools

All Implemented Interfaces:
  DSCParserConstants

    public final class DSCTools

extends Object
implements DSCParserConstants

Helper methods commonly used when dealing with DSC-compliant PostScript files.

Field Summary

Fields inherited from interface org.apache.xmlgraphics.ps.dsc.DSCParserConstants
`COMMENT, DSC_COMMENT, EOF, HEADER_COMMENT, LINE`

Method Summary
`static DSCHeaderComment` | `checkAndSkipDSC30Header(DSCParser parser)` Verifies that the file being parsed is a DSC 3.0 file.
`static boolean` | `headerCommentsEndHere(DSCEvent event)` Indicates whether the given event ends a header comment section according to the rules in DSC 3.0, chapter 4.4.
`static DSCComment` | `nextPageOrTrailer(DSCParser parser, PSGenerator gen)` Advances the parser to the next page or to the trailer or the end of file comment.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### headerCommentsEndHere

    public static boolean headerCommentsEndHere(DSCEvent event)

  Indicates whether the given event ends a header comment section according to the rules in DSC 3.0, chapter 4.4.

  Parameters:
    `event` - the event to check
  Returns:
    true if a header comment section would be ended either explicitely or implicitely by the given event

### checkAndSkipDSC30Header

    public static DSCHeaderComment checkAndSkipDSC30Header(DSCParser parser)
                                                    throws DSCException,
                                                           IOException

  Verifies that the file being parsed is a DSC 3.0 file.

  Parameters:
    `parser` - the DSC parser
  Returns:
    the header comment event
  Throws:
    `DSCException` - In case of a violation of the DSC spec
    `IOException` - In case of an I/O problem

### nextPageOrTrailer

    public static DSCComment nextPageOrTrailer(DSCParser parser,
                                               PSGenerator gen)
                                        throws IOException,
                                               DSCException

  Advances the parser to the next page or to the trailer or the end of file comment.

  Parameters:
    `parser` - the DSC parser
    `gen` - the PSGenerator instance to pass the skipped events through to
  Returns:
    the DSC comment found (Page, Trailer or EOF)
  Throws:
    `IOException` - In case of an I/O error
    `DSCException` - In case of a violation of the DSC spec

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| xmlgraphics-commons 1.5
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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