Examples of PSSetPageDevice


Examples of org.apache.fop.render.ps.extensions.PSSetPageDevice

                         * Extract all PSSetPageDevice instances from the
                         * attachment list on the s-p-m and add all dictionary
                         * entries to our internal representation of the the
                         * page device dictionary.
                         */
                        PSSetPageDevice setPageDevice = (PSSetPageDevice)attachment;
                        String content = setPageDevice.getContent();
                        if (content != null) {
                            try {
                                this.pageDeviceDictionary.putAll(PSDictionary.valueOf(content));
                            } catch (PSDictionaryFormatException e) {
                                log.error("Failed to parse dictionary string: "
View Full Code Here

Examples of org.apache.fop.render.ps.extensions.PSSetPageDevice

                     * Extract all PSSetPageDevice instances from the
                     * attachment list on the s-p-m and add all
                     * dictionary entries to our internal representation
                     * of the the page device dictionary.
                     */
                    PSSetPageDevice setPageDevice = (PSSetPageDevice)attachment;
                    String content = setPageDevice.getContent();
                    if (content != null) {
                        try {
                            pageDeviceDictionary.putAll(PSDictionary.valueOf(content));
                        } catch (PSDictionaryFormatException e) {
                            log.error("failed to parse dictionary string: "
                                    + e.getMessage() + ", [" + content + "]");
                        }
                    }
                }
            }
        }

        try {
            if (setupCodeList != null) {
                writeEnclosedExtensionAttachments(setupCodeList);
                setupCodeList.clear();
            }
        } catch (IOException e) {
            log.error(e.getMessage());
        }
        final Integer zero = new Integer(0);
        Rectangle2D pageBoundingBox = new Rectangle2D.Double();
        if (rotate) {
            pageBoundingBox.setRect(0, 0, pageHeight, pageWidth);
            gen.writeDSCComment(DSCConstants.PAGE_BBOX, new Object[] {
                    zero, zero, new Long(Math.round(pageHeight)),
                    new Long(Math.round(pageWidth)) });
            gen.writeDSCComment(DSCConstants.PAGE_HIRES_BBOX, new Object[] {
                    zero, zero, new Double(pageHeight),
                    new Double(pageWidth) });
            gen.writeDSCComment(DSCConstants.PAGE_ORIENTATION, "Landscape");
        } else {
            pageBoundingBox.setRect(0, 0, pageWidth, pageHeight);
            gen.writeDSCComment(DSCConstants.PAGE_BBOX, new Object[] {
                    zero, zero, new Long(Math.round(pageWidth)),
                    new Long(Math.round(pageHeight)) });
            gen.writeDSCComment(DSCConstants.PAGE_HIRES_BBOX, new Object[] {
                    zero, zero, new Double(pageWidth),
                    new Double(pageHeight) });
            if (autoRotateLandscape) {
                gen.writeDSCComment(DSCConstants.PAGE_ORIENTATION,
                        "Portrait");
            }
        }
        this.documentBoundingBox.add(pageBoundingBox);
        gen.writeDSCComment(DSCConstants.PAGE_RESOURCES,
                new Object[] {DSCConstants.ATEND});

        gen.commentln("%FOPSimplePageMaster: " + page.getSimplePageMasterName());

        gen.writeDSCComment(DSCConstants.BEGIN_PAGE_SETUP);

        if (page.hasExtensionAttachments()) {
            List extensionAttachments = page.getExtensionAttachments();
            for (int i = 0; i < extensionAttachments.size(); i++) {
                Object attObj = extensionAttachments.get(i);
                if (attObj instanceof PSExtensionAttachment) {
                    PSExtensionAttachment attachment = (PSExtensionAttachment)attObj;
                    if (attachment instanceof PSCommentBefore) {
                        gen.commentln("%" + attachment.getContent());
                    }
                }
            }
        }

        // Write any unwritten changes to page device dictionary
        if (!pageDeviceDictionary.isEmpty()) {
            String content = pageDeviceDictionary.getContent();
            if (safeSetPageDevice) {
                content += " SSPD";
            } else {
                content += " setpagedevice";
            }
            writeEnclosedExtensionAttachment(new PSSetPageDevice(content));
        }

        if (rotate) {
            gen.writeln(Math.round(pageHeight) + " 0 translate");
            gen.writeln("90 rotate");
View Full Code Here

Examples of org.apache.fop.render.ps.extensions.PSSetPageDevice

                if (psUtil.isSafeSetPageDevice()) {
                    content += " SSPD";
                } else {
                    content += " setpagedevice";
                }
                PSRenderingUtil.writeEnclosedExtensionAttachment(gen, new PSSetPageDevice(content));
            }

            double pageHeight = this.currentPageDefinition.dimensions.getHeight();
            if (this.currentPageDefinition.rotate) {
                gen.writeln(gen.formatDouble(pageHeight) + " 0 translate");
View Full Code Here

Examples of org.apache.fop.render.ps.extensions.PSSetPageDevice

                 * Extract all PSSetPageDevice instances from the
                 * attachment list on the s-p-m and add all dictionary
                 * entries to our internal representation of the the
                 * page device dictionary.
                 */
                PSSetPageDevice setPageDevice = (PSSetPageDevice)extension;
                String content = setPageDevice.getContent();
                if (content != null) {
                    try {
                        this.pageDeviceDictionary.putAll(PSDictionary.valueOf(content));
                    } catch (PSDictionaryFormatException e) {
                        PSEventProducer eventProducer = PSEventProducer.Provider.get(
View Full Code Here

Examples of org.apache.fop.render.ps.extensions.PSSetPageDevice

                         * Extract all PSSetPageDevice instances from the
                         * attachment list on the s-p-m and add all dictionary
                         * entries to our internal representation of the the
                         * page device dictionary.
                         */
                        PSSetPageDevice setPageDevice = (PSSetPageDevice)attachment;
                        String content = setPageDevice.getContent();
                        if (content != null) {
                            try {
                                this.pageDeviceDictionary.putAll(PSDictionary.valueOf(content));
                            } catch (PSDictionaryFormatException e) {
                                PSEventProducer eventProducer = PSEventProducer.Provider.get(
View Full Code Here

Examples of org.apache.fop.render.ps.extensions.PSSetPageDevice

                     * Extract all PSSetPageDevice instances from the
                     * attachment list on the s-p-m and add all
                     * dictionary entries to our internal representation
                     * of the the page device dictionary.
                     */
                    PSSetPageDevice setPageDevice = (PSSetPageDevice)attachment;
                    String content = setPageDevice.getContent();
                    if (content != null) {
                        try {
                            pageDeviceDictionary.putAll(PSDictionary.valueOf(content));
                        } catch (PSDictionaryFormatException e) {
                            PSEventProducer eventProducer = PSEventProducer.Provider.get(
                                    getUserAgent().getEventBroadcaster());
                            eventProducer.postscriptDictionaryParseError(this, content, e);
                        }
                    }
                }
            }
        }

        try {
            if (setupCodeList != null) {
                PSRenderingUtil.writeEnclosedExtensionAttachments(gen, setupCodeList);
                setupCodeList.clear();
            }
        } catch (IOException e) {
            log.error(e.getMessage());
        }
        final Integer zero = new Integer(0);
        Rectangle2D pageBoundingBox = new Rectangle2D.Double();
        if (rotate) {
            pageBoundingBox.setRect(0, 0, pageHeight, pageWidth);
            gen.writeDSCComment(DSCConstants.PAGE_BBOX, new Object[] {
                    zero, zero, new Long(Math.round(pageHeight)),
                    new Long(Math.round(pageWidth)) });
            gen.writeDSCComment(DSCConstants.PAGE_HIRES_BBOX, new Object[] {
                    zero, zero, new Double(pageHeight),
                    new Double(pageWidth) });
            gen.writeDSCComment(DSCConstants.PAGE_ORIENTATION, "Landscape");
        } else {
            pageBoundingBox.setRect(0, 0, pageWidth, pageHeight);
            gen.writeDSCComment(DSCConstants.PAGE_BBOX, new Object[] {
                    zero, zero, new Long(Math.round(pageWidth)),
                    new Long(Math.round(pageHeight)) });
            gen.writeDSCComment(DSCConstants.PAGE_HIRES_BBOX, new Object[] {
                    zero, zero, new Double(pageWidth),
                    new Double(pageHeight) });
            if (getPSUtil().isAutoRotateLandscape()) {
                gen.writeDSCComment(DSCConstants.PAGE_ORIENTATION,
                        "Portrait");
            }
        }
        this.documentBoundingBox.add(pageBoundingBox);
        gen.writeDSCComment(DSCConstants.PAGE_RESOURCES,
                new Object[] {DSCConstants.ATEND});

        gen.commentln("%FOPSimplePageMaster: " + page.getSimplePageMasterName());

        gen.writeDSCComment(DSCConstants.BEGIN_PAGE_SETUP);

        if (page.hasExtensionAttachments()) {
            List extensionAttachments = page.getExtensionAttachments();
            for (int i = 0; i < extensionAttachments.size(); i++) {
                Object attObj = extensionAttachments.get(i);
                if (attObj instanceof PSExtensionAttachment) {
                    PSExtensionAttachment attachment = (PSExtensionAttachment)attObj;
                    if (attachment instanceof PSCommentBefore) {
                        gen.commentln("%" + attachment.getContent());
                    } else if (attachment instanceof PSSetupCode) {
                        gen.writeln(attachment.getContent());
                    }
                }
            }
        }

        // Write any unwritten changes to page device dictionary
        if (!pageDeviceDictionary.isEmpty()) {
            String content = pageDeviceDictionary.getContent();
            if (getPSUtil().isSafeSetPageDevice()) {
                content += " SSPD";
            } else {
                content += " setpagedevice";
            }
            PSRenderingUtil.writeEnclosedExtensionAttachment(gen, new PSSetPageDevice(content));
        }

        if (rotate) {
            gen.writeln(Math.round(pageHeight) + " 0 translate");
            gen.writeln("90 rotate");
View Full Code Here

Examples of org.apache.fop.render.ps.extensions.PSSetPageDevice

                if (psUtil.isSafeSetPageDevice()) {
                    content += " SSPD";
                } else {
                    content += " setpagedevice";
                }
                PSRenderingUtil.writeEnclosedExtensionAttachment(gen, new PSSetPageDevice(content));
            }

            double pageHeight = this.currentPageDefinition.dimensions.getHeight();
            if (this.currentPageDefinition.rotate) {
                gen.writeln(gen.formatDouble(pageHeight) + " 0 translate");
View Full Code Here

Examples of org.apache.fop.render.ps.extensions.PSSetPageDevice

                 * Extract all PSSetPageDevice instances from the
                 * attachment list on the s-p-m and add all dictionary
                 * entries to our internal representation of the the
                 * page device dictionary.
                 */
                PSSetPageDevice setPageDevice = (PSSetPageDevice)extension;
                String content = setPageDevice.getContent();
                if (content != null) {
                    try {
                        this.pageDeviceDictionary.putAll(PSDictionary.valueOf(content));
                    } catch (PSDictionaryFormatException e) {
                        PSEventProducer eventProducer = PSEventProducer.Provider.get(
View Full Code Here

Examples of org.apache.fop.render.ps.extensions.PSSetPageDevice

                if (psUtil.isSafeSetPageDevice()) {
                    content += " SSPD";
                } else {
                    content += " setpagedevice";
                }
                PSRenderingUtil.writeEnclosedExtensionAttachment(gen, new PSSetPageDevice(content));
            }

            double pageHeight = this.currentPageDefinition.dimensions.getHeight();
            if (this.currentPageDefinition.rotate) {
                gen.writeln(gen.formatDouble(pageHeight) + " 0 translate");
View Full Code Here

Examples of org.apache.fop.render.ps.extensions.PSSetPageDevice

                 * Extract all PSSetPageDevice instances from the
                 * attachment list on the s-p-m and add all dictionary
                 * entries to our internal representation of the the
                 * page device dictionary.
                 */
                PSSetPageDevice setPageDevice = (PSSetPageDevice)extension;
                String content = setPageDevice.getContent();
                if (content != null) {
                    try {
                        this.pageDeviceDictionary.putAll(PSDictionary.valueOf(content));
                    } catch (PSDictionaryFormatException e) {
                        PSEventProducer eventProducer = PSEventProducer.Provider.get(
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.