Examples of DSCCommentPage


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

            throw new DSCException("Page expected, but none found");
        }
       
        //Process individual pages (and skip as necessary)
        while (true) {
            DSCCommentPage page = (DSCCommentPage)pageOrTrailer;
            page.generate(gen);
            pageOrTrailer = DSCTools.nextPageOrTrailer(parser, gen);
            if (pageOrTrailer == null) {
                reportInvalidDSC();
            } else if (!DSCConstants.PAGE.equals(pageOrTrailer.getName())) {
                pageOrTrailer.generate(gen);
View Full Code Here

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

        }
        parser.setFilter(null); //Remove filter

        //Process individual pages (and skip as necessary)
        while (true) {
            DSCCommentPage page = (DSCCommentPage)pageOrTrailer;
            boolean validPage = (page.getPagePosition() >= from && page.getPagePosition() <= to);
            if (validPage) {
                page.setPagePosition(page.getPagePosition() - from + 1);
                page.generate(gen);
                pageCount++;
            }
            pageOrTrailer = DSCTools.nextPageOrTrailer(parser, (validPage ? gen : null));
            if (pageOrTrailer == null) {
                throw new DSCException("File is not DSC-compliant: Unexpected end of file");
View Full Code Here

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

        }
        parser.setFilter(null); //Remove filter
       
        //Process individual pages (and skip as necessary)
        while (true) {
            DSCCommentPage page = (DSCCommentPage)pageOrTrailer;
            boolean validPage = (page.getPagePosition() >= from && page.getPagePosition() <= to);
            if (validPage) {
                page.setPagePosition(page.getPagePosition() - from + 1);
                page.generate(gen);
                pageCount++;
            }
            pageOrTrailer = DSCTools.nextPageOrTrailer(parser, (validPage ? gen : null));
            if (pageOrTrailer == null) {
                throw new DSCException("File is not DSC-compliant: Unexpected end of file");
View Full Code Here

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

            throw new DSCException("Page expected, but none found");
        }
       
        //Process individual pages (and skip as necessary)
        while (true) {
            DSCCommentPage page = (DSCCommentPage)pageOrTrailer;
            page.generate(gen);
            pageOrTrailer = DSCTools.nextPageOrTrailer(parser, gen);
            if (pageOrTrailer == null) {
                reportInvalidDSC();
            } else if (!DSCConstants.PAGE.equals(pageOrTrailer.getName())) {
                pageOrTrailer.generate(gen);
View Full Code Here

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

        }
        parser.setFilter(null); //Remove filter

        //Process individual pages (and skip as necessary)
        while (true) {
            DSCCommentPage page = (DSCCommentPage)pageOrTrailer;
            boolean validPage = (page.getPagePosition() >= from && page.getPagePosition() <= to);
            if (validPage) {
                page.setPagePosition(page.getPagePosition() - from + 1);
                page.generate(gen);
                pageCount++;
            }
            pageOrTrailer = DSCTools.nextPageOrTrailer(parser, (validPage ? gen : null));
            if (pageOrTrailer == null) {
                throw new DSCException("File is not DSC-compliant: Unexpected end of file");
View Full Code Here

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

            assertNotNull(gotoDSCComment(parser, DSCConstants.END_SETUP));
            //Now the actual pages begin

            //---=== Page 1 ===---
            DSCCommentPage page = (DSCCommentPage)gotoDSCComment(parser, DSCConstants.PAGE);
            assertEquals(1, page.getPagePosition());

            assertEquals(DSCAtend.class,
                    gotoDSCComment(parser, DSCConstants.PAGE_RESOURCES).getClass());
            assertNotNull(gotoDSCComment(parser, DSCConstants.BEGIN_PAGE_SETUP));
            assertNotNull(gotoDSCComment(parser, DSCConstants.END_PAGE_SETUP));

            PSResource form2 = new PSResource(PSResource.TYPE_FORM, "FOPForm:2");
            checkResourceComment(parser, DSCConstants.BEGIN_RESOURCE, form2);
            assertNotNull(gotoDSCComment(parser, DSCConstants.PAGE_TRAILER));

            AbstractResourcesDSCComment pageResources;
            pageResources = (AbstractResourcesDSCComment)gotoDSCComment(
                    parser, DSCConstants.PAGE_RESOURCES);
            resources = pageResources.getResources();
            assertEquals(5, resources.size());
            assertTrue(resources.contains(form1));
            assertTrue(resources.contains(form2));
            assertTrue(resources.contains(helvetica));
            assertTrue(resources.contains(helveticaBold));

            //---=== Page 2 ===---
            page = (DSCCommentPage)gotoDSCComment(parser, DSCConstants.PAGE);
            assertEquals(2, page.getPagePosition());

            assertEquals(DSCAtend.class,
                    gotoDSCComment(parser, DSCConstants.PAGE_RESOURCES).getClass());
            assertNotNull(gotoDSCComment(parser, DSCConstants.BEGIN_PAGE_SETUP));
            assertNotNull(gotoDSCComment(parser, DSCConstants.END_PAGE_SETUP));
View Full Code Here

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

                assertContains(resourceContent, "/DCTDecode filter");
                assertAbsent(resourceContent, "/ReusableStreamDecode filter");
            }

            //---=== Page 1 ===---
            DSCCommentPage page = (DSCCommentPage)gotoDSCComment(parser, DSCConstants.PAGE);
            assertEquals(1, page.getPagePosition());

            PSResource form1 = new PSResource(PSResource.TYPE_FORM, "FOPForm:1");
            checkResourceComment(parser, DSCConstants.BEGIN_RESOURCE, form1);
            title = (DSCCommentTitle)parser.nextEvent().asDSCComment();
            assertEquals("image/jpeg test/resources/images/bgimg72dpi.jpg", title.getTitle());
View Full Code Here

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

            throw new DSCException("Page expected, but none found");
        }

        //Process individual pages (and skip as necessary)
        while (true) {
            DSCCommentPage page = (DSCCommentPage)pageOrTrailer;
            page.generate(gen);
            pageOrTrailer = DSCTools.nextPageOrTrailer(parser, gen);
            if (pageOrTrailer == null) {
                reportInvalidDSC();
            } else if (!DSCConstants.PAGE.equals(pageOrTrailer.getName())) {
                pageOrTrailer.generate(gen);
View Full Code Here

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

                assertContains(resourceContent, "/DCTDecode filter");
                assertAbsent(resourceContent, "/ReusableStreamDecode filter");
            }

            //---=== Page 1 ===---
            DSCCommentPage page = (DSCCommentPage)gotoDSCComment(parser, DSCConstants.PAGE);
            assertEquals(1, page.getPagePosition());

            PSResource form1 = new PSResource(PSResource.TYPE_FORM, "FOPForm:1");
            checkResourceComment(parser, DSCConstants.BEGIN_RESOURCE, form1);
            title = (DSCCommentTitle)parser.nextEvent().asDSCComment();
            assertEquals("image/jpeg test/resources/images/bgimg72dpi.jpg", title.getTitle());
View Full Code Here

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

            assertNotNull(gotoDSCComment(parser, DSCConstants.END_SETUP));
            //Now the actual pages begin

            //---=== Page 1 ===---
            DSCCommentPage page = (DSCCommentPage)gotoDSCComment(parser, DSCConstants.PAGE);
            assertEquals(1, page.getPagePosition());

            assertEquals(DSCAtend.class,
                    gotoDSCComment(parser, DSCConstants.PAGE_RESOURCES).getClass());
            assertNotNull(gotoDSCComment(parser, DSCConstants.BEGIN_PAGE_SETUP));
            assertNotNull(gotoDSCComment(parser, DSCConstants.END_PAGE_SETUP));

            PSResource form2 = new PSResource(PSResource.TYPE_FORM, "FOPForm:2");
            checkResourceComment(parser, DSCConstants.BEGIN_RESOURCE, form2);
            assertNotNull(gotoDSCComment(parser, DSCConstants.PAGE_TRAILER));

            AbstractResourcesDSCComment pageResources;
            pageResources = (AbstractResourcesDSCComment)gotoDSCComment(
                    parser, DSCConstants.PAGE_RESOURCES);
            resources = pageResources.getResources();
            assertEquals(5, resources.size());
            assertTrue(resources.contains(form1));
            assertTrue(resources.contains(form2));
            assertTrue(resources.contains(helvetica));
            assertTrue(resources.contains(helveticaBold));

            //---=== Page 2 ===---
            page = (DSCCommentPage)gotoDSCComment(parser, DSCConstants.PAGE);
            assertEquals(2, page.getPagePosition());

            assertEquals(DSCAtend.class,
                    gotoDSCComment(parser, DSCConstants.PAGE_RESOURCES).getClass());
            assertNotNull(gotoDSCComment(parser, DSCConstants.BEGIN_PAGE_SETUP));
            assertNotNull(gotoDSCComment(parser, DSCConstants.END_PAGE_SETUP));
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.