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

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


            }
            event.generate(gen);
        }
       
        //Skip to the FOPFontSetup
        PostScriptComment fontSetupPlaceholder = parser.nextPSComment("FOPFontSetup", gen);
        if (fontSetupPlaceholder == null) {
            throw new DSCException("Didn't find %FOPFontSetup comment in stream");
        }
        PSFontUtils.writeFontDict(gen, fontInfo, fontInfo.getUsedFonts());
        generateForms(resTracker, userAgent, formResources, gen);
View Full Code Here


                }
                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);
            }
        } else {
            this.nextEvent = null;
View Full Code Here

    public PostScriptComment nextPSComment(String prefix, PSGenerator gen)
                    throws IOException, DSCException {
            while (hasNext()) {
                DSCEvent event = nextEvent();
                if (event.isComment()) {
                    PostScriptComment comment = (PostScriptComment)event;
                    if (comment.getComment().startsWith(prefix)) {
                        return comment;
                    }
                }
                if (gen != null) {
                    event.generate(gen); //Pipe through to PSGenerator
View Full Code Here

                }
                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);
            }
            if (this.filter != null && !filter.accept(this.nextEvent)) {
                parseNext(); //skip
View Full Code Here

    public PostScriptComment nextPSComment(String prefix, PSGenerator gen)
                    throws IOException, DSCException {
            while (hasNext()) {
                DSCEvent event = nextEvent();
                if (event.isComment()) {
                    PostScriptComment comment = (PostScriptComment)event;
                    if (comment.getComment().startsWith(prefix)) {
                        return comment;
                    }
                }
                if (gen != null) {
                    event.generate(gen); //Pipe through to PSGenerator
View Full Code Here

        DSCEvent event;
       
        event = new DSCCommentEndComments();
        assertTrue(DSCTools.headerCommentsEndHere(event));

        event = new PostScriptComment("FOPTest");
        assertFalse(DSCTools.headerCommentsEndHere(event));

        event = new DSCCommentPages(7);
        assertFalse(DSCTools.headerCommentsEndHere(event));

        event = new PostScriptComment(null);
        assertTrue(DSCTools.headerCommentsEndHere(event));

        event = new PostScriptComment("\t");
        assertTrue(DSCTools.headerCommentsEndHere(event));

        event = new PostScriptComment(" ***");
        assertTrue(DSCTools.headerCommentsEndHere(event));

        event = new PostScriptLine("/pgsave save def");
        assertTrue(DSCTools.headerCommentsEndHere(event));
    }
View Full Code Here

            }
            event.generate(gen);
        }
       
        //Skip to the FOPFontSetup
        PostScriptComment fontSetupPlaceholder = parser.nextPSComment("FOPFontSetup", gen);
        if (fontSetupPlaceholder == null) {
            throw new DSCException("Didn't find %FOPFontSetup comment in stream");
        }
        PSFontUtils.writeFontDict(gen, fontInfo, fontInfo.getUsedFonts());
        generateForms(resTracker, userAgent, formResources, gen);
View Full Code Here

        DSCEvent event;

        event = new DSCCommentEndComments();
        assertTrue(DSCTools.headerCommentsEndHere(event));

        event = new PostScriptComment("FOPTest");
        assertFalse(DSCTools.headerCommentsEndHere(event));

        event = new DSCCommentPages(7);
        assertFalse(DSCTools.headerCommentsEndHere(event));

        event = new PostScriptComment(null);
        assertTrue(DSCTools.headerCommentsEndHere(event));

        event = new PostScriptComment("\t");
        assertTrue(DSCTools.headerCommentsEndHere(event));

        event = new PostScriptComment(" ***");
        assertTrue(DSCTools.headerCommentsEndHere(event));

        event = new PostScriptLine("/pgsave save def");
        assertTrue(DSCTools.headerCommentsEndHere(event));
    }
View Full Code Here

                }
                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);
            }
        } else {
            this.nextEvent = null;
View Full Code Here

    public PostScriptComment nextPSComment(String prefix, PSGenerator gen)
                    throws IOException, DSCException {
            while (hasNext()) {
                DSCEvent event = nextEvent();
                if (event.isComment()) {
                    PostScriptComment comment = (PostScriptComment)event;
                    if (comment.getComment().startsWith(prefix)) {
                        return comment;
                    }
                }
                if (gen != null) {
                    event.generate(gen); //Pipe through to PSGenerator
View Full Code Here

TOP

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

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.