All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xhtmlrenderer.test.Graphics2DRendererTest Maven / Gradle / Ivy

Go to download

Flying Saucer is a CSS 2.1 renderer written in Java. This artifact contains the core rendering and layout code as well as Java2D output.

There is a newer version: 9.11.0
Show newest version
package org.xhtmlrenderer.test;

import org.xhtmlrenderer.simple.Graphics2DRenderer;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;

public class Graphics2DRendererTest {

    public static void main(String[] args) throws Exception {
        BufferedImage img = Graphics2DRenderer.renderToImageAutoSize(new File("demos/splash/splash.html").toURL().toExternalForm(),
                700, BufferedImage.TYPE_INT_ARGB);
        ImageIO.write(img, "png", new File("test.png"));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy