Package org.apache.xmlgraphics.ps.dsc.events

Examples of org.apache.xmlgraphics.ps.dsc.events.DSCHeaderComment


        if (!parser.hasNext()) {
            throw new DSCException("File has no content");
        }
        DSCEvent event = parser.nextEvent();
        if (event.getEventType() == HEADER_COMMENT) {
            DSCHeaderComment header = (DSCHeaderComment)event;
            if (!header.isPSAdobe30()) {
                throw new DSCException("PostScript file does not start with '"
                        + DSCConstants.PS_ADOBE_30 + "'");
            }
            return header;
        } else {
View Full Code Here


        PSGenerator gen = new PSGenerator(out);
        parser.addListener(new DefaultNestedDocumentHandler(gen));
        int pageCount = 0;

        //Skip DSC header
        DSCHeaderComment header = DSCTools.checkAndSkipDSC30Header(parser);
        header.generate(gen);
        //Set number of pages
        DSCCommentPages pages = new DSCCommentPages(to - from + 1);
        pages.generate(gen);

        parser.setFilter(new DSCFilter() {
View Full Code Here

     * @param handler the DSCHandler instance to send the events to
     * @throws IOException In case of an I/O error
     * @throws DSCException In case of a violation of the DSC spec
     */
    public void parse(DSCHandler handler) throws IOException, DSCException {
        DSCHeaderComment header = DSCTools.checkAndSkipDSC30Header(this);
        handler.startDocument("%!" + header.getComment());
        DSCEvent event;
        while (hasNext()) {
            event = nextEvent();
            switch (event.getEventType()) {
            case HEADER_COMMENT:
View Full Code Here

                if (comment.getEventType() == EOF && isCheckEOF()) {
                    this.eofFound = true;
                }
                this.nextEvent = comment;
            } else if (line.startsWith("%!")) {
                this.nextEvent = new DSCHeaderComment(line.substring(2));
            } else if (line.startsWith("%")) {
                this.nextEvent = new PostScriptComment(line.substring(1));
            } else {
                this.nextEvent = new PostScriptLine(line);
            }
View Full Code Here

        PSGenerator gen = new PSGenerator(out);
        parser.addListener(new DefaultNestedDocumentHandler(gen));
        parser.addListener(new IncludeResourceListener(gen));

        //Skip DSC header
        DSCHeaderComment header = DSCTools.checkAndSkipDSC30Header(parser);
        header.generate(gen);

        parser.setFilter(new DSCFilter() {
            private final Set filtered = new java.util.HashSet();
            {
                //We rewrite those as part of the processing
View Full Code Here

        PSGenerator gen = new PSGenerator(out);
        parser.addListener(new DefaultNestedDocumentHandler(gen));
        parser.addListener(new IncludeResourceListener(gen));

        //Skip DSC header
        DSCHeaderComment header = DSCTools.checkAndSkipDSC30Header(parser);
        header.generate(gen);

        parser.setFilter(new DSCFilter() {
            private final Set filtered = new java.util.HashSet();
            {
                //We rewrite those as part of the processing
View Full Code Here

     * @param handler the DSCHandler instance to send the events to
     * @throws IOException In case of an I/O error
     * @throws DSCException In case of a violation of the DSC spec
     */
    public void parse(DSCHandler handler) throws IOException, DSCException {
        DSCHeaderComment header = DSCTools.checkAndSkipDSC30Header(this);
        handler.startDocument("%!" + header.getComment());
        DSCEvent event;
        while (hasNext()) {
            event = nextEvent();
            switch (event.getEventType()) {
            case HEADER_COMMENT:
View Full Code Here

                if (comment.getEventType() == EOF) {
                    this.eofFound = true;
                }
                this.nextEvent = comment;
            } else if (line.startsWith("%!")) {
                this.nextEvent = new DSCHeaderComment(line.substring(2));
            } else if (line.startsWith("%")) {
                this.nextEvent = new PostScriptComment(line.substring(1));
            } else {
                this.nextEvent = new PostScriptLine(line);
            }
View Full Code Here

        PSGenerator gen = new PSGenerator(out);
        parser.addListener(new DefaultNestedDocumentHandler(gen));
        parser.addListener(new IncludeResourceListener(gen));

        //Skip DSC header
        DSCHeaderComment header = DSCTools.checkAndSkipDSC30Header(parser);
        header.generate(gen);

        parser.setFilter(new DSCFilter() {
            private final Set filtered = new java.util.HashSet();
            {
                //We rewrite those as part of the processing
View Full Code Here

TOP

Related Classes of org.apache.xmlgraphics.ps.dsc.events.DSCHeaderComment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.