Examples of newFOUserAgent()


Examples of org.apache.fop.apps.FopFactory.newFOUserAgent()

        ua = fopFactory.newFOUserAgent();
        foEventHandler = factory.createFOEventHandler(
                ua, MimeConstants.MIME_RTF, new NullOutputStream());
        assertTrue(foEventHandler instanceof RTFHandler);

        ua = fopFactory.newFOUserAgent();
        try {
            foEventHandler = factory.createFOEventHandler(
                    ua, "invalid/format", new NullOutputStream());
            fail("Expected UnsupportedOperationException");
        } catch (UnsupportedOperationException uoe) {
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFOUserAgent()

            fail("Expected UnsupportedOperationException");
        } catch (UnsupportedOperationException uoe) {
            //expected
        }

        ua = fopFactory.newFOUserAgent();
        try {
            foEventHandler = factory.createFOEventHandler(
                    ua, MimeConstants.MIME_PDF, null);
            fail("Expected FOPException because of missing OutputStream");
        } catch (FOPException fe) {
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFOUserAgent()

            fail("Expected FOPException because of missing OutputStream");
        } catch (FOPException fe) {
            //expected
        }

        ua = fopFactory.newFOUserAgent();
        overrideFOEventHandler = new RTFHandler(ua, new NullOutputStream());
        ua.setFOEventHandlerOverride(overrideFOEventHandler);
        foEventHandler = factory.createFOEventHandler(
                ua, null, null);
        assertTrue(foEventHandler == overrideFOEventHandler);
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFOUserAgent()

                ttfFile.getCanonicalPath(), metricsFile.getCanonicalPath()};
        TTFReader.main(args);
        assertTrue(metricsFile.isFile());

        FopFactory fopFactory = FopFactory.newInstance();
        FOUserAgent ua = fopFactory.newFOUserAgent();
        PDFRenderer renderer = new PDFRenderer();
        renderer.setUserAgent(ua);
        List fontList = new java.util.ArrayList();
        List triplets = new java.util.ArrayList();
        triplets.add(new FontTriplet(fontFamily, "normal", Font.WEIGHT_NORMAL));
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFOUserAgent()

    private void givenAConfigurationFile(String filename, EventListener eventListener)
            throws Exception {
        FopFactory fopFactory = FopFactory.newInstance();
        fopFactory.setUserConfig(new File("test/resources/org/apache/fop/render/pdf/"
                + filename + ".xconf"));
        foUserAgent = fopFactory.newFOUserAgent();
        foUserAgent.getEventBroadcaster().addEventListener(eventListener);
    }

    private void whenCreatingAndConfiguringDocumentHandler() throws FOPException {
        PDFDocumentHandlerMaker maker = new PDFDocumentHandlerMaker();
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFOUserAgent()

     * @throws Exception if an error occurs
     */
    @Test
    public void testRGB() throws Exception {
        FopFactory fopFactory = FopFactory.newInstance();
        FOUserAgent ua = fopFactory.newFOUserAgent();
        Color colActual;

        colActual = ColorUtil.parseColorString(ua, "rgb(255, 40, 0)");
        assertEquals(255, colActual.getRed());
        assertEquals(40, colActual.getGreen());
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFOUserAgent()

                "file:src/java/org/apache/fop/pdf/sRGB%20Color%20Space%20Profile.icm");
        ColorSpace cs = fopFactory.getColorSpaceCache().get(
                "sRGBAlt", null, sRGBLoc.toASCIIString(), RenderingIntent.AUTO);
        assertNotNull("Color profile not found", cs);

        FOUserAgent ua = fopFactory.newFOUserAgent();
        ColorWithFallback colActual;

        //fop-rgb-icc() is used instead of rgb-icc() inside FOP!
        String colSpec = "fop-rgb-icc(1.0,0.0,0.0,sRGBAlt,"
            + "\"" + sRGBLoc.toASCIIString() + "\",1.0,0.0,0.0)";
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFOUserAgent()

        URI ncpLoc = new URI("file:test/resources/color/ncp-example.icc");
        ColorSpace cs = fopFactory.getColorSpaceCache().get(
                "NCP", null, ncpLoc.toASCIIString(), RenderingIntent.AUTO);
        assertNotNull("Color profile not found", cs);

        FOUserAgent ua = fopFactory.newFOUserAgent();
        ColorWithFallback colActual;

        //fop-rgb-named-color() is used instead of rgb-named-color() inside FOP!
        String colSpec = "fop-rgb-named-color(1.0,0.8,0.0,NCP,"
            + "\"" + ncpLoc.toASCIIString() + "\",Postgelb)";
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFOUserAgent()

        FopFactory ff = FopFactory.newInstance();
        ff.setSourceResolution(96);
        ff.setTargetResolution(300);

        FOUserAgent userAgent = ff.newFOUserAgent();

        ImageManager manager = ff.getImageManager();
        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
        assertNotNull("ImageInfo must not be null", info);
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFOUserAgent()

    @Test
    public void testSVGWithReferences() throws Exception {
        String uri = "test/resources/fop/svg/images.svg";
        FopFactory ff = FopFactory.newInstance();
        FOUserAgent userAgent = ff.newFOUserAgent();

        ImageManager manager = ff.getImageManager();
        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
        assertNotNull("ImageInfo must not be null", info);
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.