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

Examples of org.apache.xmlgraphics.ps.dsc.events.DSCComment.generate()


            page.generate(gen);
            pageOrTrailer = DSCTools.nextPageOrTrailer(parser, gen);
            if (pageOrTrailer == null) {
                reportInvalidDSC();
            } else if (!DSCConstants.PAGE.equals(pageOrTrailer.getName())) {
                pageOrTrailer.generate(gen);
                break;
            }
        }
       
        //Write the rest
View Full Code Here


            }
            pageOrTrailer = DSCTools.nextPageOrTrailer(parser, (validPage ? gen : null));
            if (pageOrTrailer == null) {
                throw new DSCException("File is not DSC-compliant: Unexpected end of file");
            } else if (!DSCConstants.PAGE.equals(pageOrTrailer.getName())) {
                pageOrTrailer.generate(gen);
                break;
            }
        }

        //Write the rest
View Full Code Here

     */
    public void handle(DSCEvent event, DSCParser parser) throws IOException, DSCException {
        if (event.isDSCComment()) {
            DSCComment comment = event.asDSCComment();
            if (DSCConstants.BEGIN_DOCUMENT.equals(comment.getName())) {
                comment.generate(gen);
                parser.setCheckEOF(false);
                comment = parser.nextDSCComment(DSCConstants.END_DOCUMENT, gen);
                if (comment == null) {
                    throw new DSCException("File is not DSC-compliant: Didn't find an "
                            + DSCConstants.END_DOCUMENT);
View Full Code Here

                comment = parser.nextDSCComment(DSCConstants.END_DOCUMENT, gen);
                if (comment == null) {
                    throw new DSCException("File is not DSC-compliant: Didn't find an "
                            + DSCConstants.END_DOCUMENT);
                }
                comment.generate(gen);
                parser.setCheckEOF(true);
                parser.next();
            } else if (DSCConstants.BEGIN_DATA.equals(comment.getName())) {
                comment.generate(gen);
                parser.setCheckEOF(false);
View Full Code Here

                }
                comment.generate(gen);
                parser.setCheckEOF(true);
                parser.next();
            } else if (DSCConstants.BEGIN_DATA.equals(comment.getName())) {
                comment.generate(gen);
                parser.setCheckEOF(false);
                comment = parser.nextDSCComment(DSCConstants.END_DATA, gen);
                if (comment == null) {
                    throw new DSCException("File is not DSC-compliant: Didn't find an "
                            + DSCConstants.END_DATA);
View Full Code Here

                comment = parser.nextDSCComment(DSCConstants.END_DATA, gen);
                if (comment == null) {
                    throw new DSCException("File is not DSC-compliant: Didn't find an "
                            + DSCConstants.END_DATA);
                }
                comment.generate(gen);
                parser.setCheckEOF(true);
                parser.next();
            }
        }
    }
View Full Code Here

            }
            pageOrTrailer = DSCTools.nextPageOrTrailer(parser, (validPage ? gen : null));
            if (pageOrTrailer == null) {
                throw new DSCException("File is not DSC-compliant: Unexpected end of file");
            } else if (!DSCConstants.PAGE.equals(pageOrTrailer.getName())) {
                pageOrTrailer.generate(gen);
                break;
            }
        }
       
        //Write the rest
View Full Code Here

            page.generate(gen);
            pageOrTrailer = DSCTools.nextPageOrTrailer(parser, gen);
            if (pageOrTrailer == null) {
                reportInvalidDSC();
            } else if (!DSCConstants.PAGE.equals(pageOrTrailer.getName())) {
                pageOrTrailer.generate(gen);
                break;
            }
        }
       
        //Write the rest
View Full Code Here

            }
            pageOrTrailer = DSCTools.nextPageOrTrailer(parser, (validPage ? gen : null));
            if (pageOrTrailer == null) {
                throw new DSCException("File is not DSC-compliant: Unexpected end of file");
            } else if (!DSCConstants.PAGE.equals(pageOrTrailer.getName())) {
                pageOrTrailer.generate(gen);
                break;
            }
        }

        //Write the rest
View Full Code Here

    public void processEvent(DSCEvent event, DSCParser parser) throws IOException, DSCException {
        if (event.isDSCComment()) {
            DSCComment comment = event.asDSCComment();
            if (DSCConstants.BEGIN_DOCUMENT.equals(comment.getName())) {
                if (gen != null) {
                    comment.generate(gen);
                }
                parser.setCheckEOF(false);
                parser.setListenersDisabled(true);
                comment = parser.nextDSCComment(DSCConstants.END_DOCUMENT, gen);
                if (comment == null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.