Package org.apache.fop.fo

Examples of org.apache.fop.fo.XMLObj


    /**
     * Preloads the image so the intrinsic size is available.
     */
    private void prepareIntrinsicSize() {
        if (intrinsicDimensions == null) {
            XMLObj child = (XMLObj) firstChild;
            Point2D csize = new Point2D.Float(-1, -1);
            intrinsicDimensions = child.getDimension(csize);
            if (intrinsicDimensions == null) {
                log.error("Intrinsic dimensions of "
                        + " instream-foreign-object could not be determined");
            }
            intrinsicAlignmentAdjust = child.getIntrinsicAlignmentAdjust();
        }
    }
View Full Code Here


        if (bDefer) {
            return;
        }
       
        try {
            XMLObj child = (XMLObj) ifo.getChildXMLObj();
            Document doc = child.getDOMDocument();
            String ns = child.getNamespaceURI();
           
            if (SVGDOMImplementation.SVG_NAMESPACE_URI.equals(ns)) {
                // Build the image info.
                FopImage.ImageInfo info = new FopImage.ImageInfo();
                info.mimeType = "image/svg+xml";
                info.str = SVGDOMImplementation.SVG_NAMESPACE_URI;
                info.originalURI = "";
                info.data = doc;

                // Set the resolution to that of the FOUserAgent
                FOUserAgent ua = ifo.getUserAgent();
                info.dpiHorizontal = 25.4f / ua.getSourcePixelUnitToMillimeter();
                info.dpiVertical = info.dpiHorizontal;
               
                // Set the image size to the size of the svg.
                Point2D csize = new Point2D.Float(-1, -1);
                Point2D intrinsicDimensions = child.getDimension(csize);
                info.width = (int) intrinsicDimensions.getX();
                info.height = (int) intrinsicDimensions.getY();
               
                FopImage fopImage = new XMLImage(info);
                fopImage.load(FopImage.ORIGINAL_DATA);
View Full Code Here

        if (bDefer) {
            return;
        }

        try {
            XMLObj child = ifo.getChildXMLObj();
            Document doc = child.getDOMDocument();
            String ns = child.getNamespaceURI();

            ImageInfo info = new ImageInfo(null, null);
            // Set the resolution to that of the FOUserAgent
            FOUserAgent ua = ifo.getUserAgent();
            ImageSize size = new ImageSize();
            size.setResolution(ua.getSourceResolution());

            // Set the image size to the size of the svg.
            Point2D csize = new Point2D.Float(-1, -1);
            Point2D intrinsicDimensions = child.getDimension(csize);
            size.setSizeInMillipoints(
                    (int)Math.round(intrinsicDimensions.getX() * 1000),
                    (int)Math.round(intrinsicDimensions.getY() * 1000));
            size.calcPixelsFromSize();
            info.setSize(size);
View Full Code Here

        fobj = node;
    }

    /** {@inheritDoc} */
    protected Area getChildArea() {
        XMLObj child = (XMLObj) fobj.getChildXMLObj();

        org.w3c.dom.Document doc = child.getDOMDocument();
        String ns = child.getNamespaceURI();

        return new ForeignObject(doc, ns);
    }
View Full Code Here

    /**
     * Preloads the image so the intrinsic size is available.
     */
    private void prepareIntrinsicSize() {
        if (intrinsicDimensions == null) {
            XMLObj child = (XMLObj) firstChild;
            Point2D csize = new Point2D.Float(-1, -1);
            intrinsicDimensions = child.getDimension(csize);
            if (intrinsicDimensions == null) {
                log.error("Intrinsic dimensions of "
                        + " instream-foreign-object could not be determined");
            }
            intrinsicAlignmentAdjust = child.getIntrinsicAlignmentAdjust();
        }
    }
View Full Code Here

        if (bDefer) {
            return;
        }
       
        try {
            XMLObj child = (XMLObj) ifo.getChildXMLObj();
            Document doc = child.getDOMDocument();
            String ns = child.getNamespaceURI();
           
            ImageInfo info = new ImageInfo(null, null);
            // Set the resolution to that of the FOUserAgent
            FOUserAgent ua = ifo.getUserAgent();
            ImageSize size = new ImageSize();
            size.setResolution(ua.getSourceResolution());
           
            // Set the image size to the size of the svg.
            Point2D csize = new Point2D.Float(-1, -1);
            Point2D intrinsicDimensions = child.getDimension(csize);
            size.setSizeInMillipoints(
                    (int)Math.round(intrinsicDimensions.getX() * 1000),
                    (int)Math.round(intrinsicDimensions.getY() * 1000));
            size.calcPixelsFromSize();
            info.setSize(size);
View Full Code Here

        if (bDefer) {
            return;
        }

        try {
            XMLObj child = ifo.getChildXMLObj();
            Document doc = child.getDOMDocument();
            String ns = child.getNamespaceURI();

            ImageInfo info = new ImageInfo(null, null);
            // Set the resolution to that of the FOUserAgent
            FOUserAgent ua = ifo.getUserAgent();
            ImageSize size = new ImageSize();
            size.setResolution(ua.getSourceResolution());

            // Set the image size to the size of the svg.
            Point2D csize = new Point2D.Float(-1, -1);
            Point2D intrinsicDimensions = child.getDimension(csize);
            if (intrinsicDimensions == null) {
                ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                        getUserAgent().getEventBroadcaster());
                eventProducer.ifoNoIntrinsicSize(this, child.getLocator());
                return;
            }
            size.setSizeInMillipoints(
                    (int)Math.round(intrinsicDimensions.getX() * 1000),
                    (int)Math.round(intrinsicDimensions.getY() * 1000));
 
View Full Code Here

        if (bDefer) {
            return;
        }

        try {
            XMLObj child = ifo.getChildXMLObj();
            Document doc = child.getDOMDocument();
            String ns = child.getNamespaceURI();

            ImageInfo info = new ImageInfo(null, null);
            // Set the resolution to that of the FOUserAgent
            FOUserAgent ua = ifo.getUserAgent();
            ImageSize size = new ImageSize();
            size.setResolution(ua.getSourceResolution());

            // Set the image size to the size of the svg.
            Point2D csize = new Point2D.Float(-1, -1);
            Point2D intrinsicDimensions = child.getDimension(csize);
            if (intrinsicDimensions == null) {
                ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                        getUserAgent().getEventBroadcaster());
                eventProducer.ifoNoIntrinsicSize(this, child.getLocator());
                return;
            }
            size.setSizeInMillipoints(
                    (int)Math.round(intrinsicDimensions.getX() * 1000),
                    (int)Math.round(intrinsicDimensions.getY() * 1000));
 
View Full Code Here

    }

    /** Preloads the image so the intrinsic size is available. */
    private void prepareIntrinsicSize() {
        if (!this.instrisicSizeDetermined) {
            XMLObj child = (XMLObj) firstChild;
            Point2D csize = new Point2D.Float(-1, -1);
            intrinsicDimensions = child.getDimension(csize);
            if (intrinsicDimensions == null) {
                ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                        getUserAgent().getEventBroadcaster());
                eventProducer.ifoNoIntrinsicSize(this, getLocator());
            }
            intrinsicAlignmentAdjust = child.getIntrinsicAlignmentAdjust();
            this.instrisicSizeDetermined = true;
        }
    }
View Full Code Here

        if (bDefer) {
            return;
        }
       
        try {
            XMLObj child = (XMLObj) ifo.getChildXMLObj();
            Document doc = child.getDOMDocument();
            String ns = child.getNamespaceURI();
           
            if (SVGDOMImplementation.SVG_NAMESPACE_URI.equals(ns)) {
                // Build the image info.
                FopImage.ImageInfo info = new FopImage.ImageInfo();
                info.mimeType = "image/svg+xml";
                info.str = SVGDOMImplementation.SVG_NAMESPACE_URI;
                info.originalURI = "";
                info.data = doc;

                // Set the resolution to that of the FOUserAgent
                FOUserAgent ua = ifo.getUserAgent();
                info.dpiHorizontal = 25.4f / ua.getSourcePixelUnitToMillimeter();
                info.dpiVertical = info.dpiHorizontal;
               
                // Set the image size to the size of the svg.
                Point2D csize = new Point2D.Float(-1, -1);
                Point2D intrinsicDimensions = child.getDimension(csize);
                info.width = (int) intrinsicDimensions.getX();
                info.height = (int) intrinsicDimensions.getY();
               
                FopImage fopImage = new XMLImage(info);
                fopImage.load(FopImage.ORIGINAL_DATA);
View Full Code Here

TOP

Related Classes of org.apache.fop.fo.XMLObj

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.