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

com.openhtmltopdf.java2d.Java2DObjectDrawerReplacedElement Maven / Gradle / Ivy

Go to download

Openhtmltopdf is a CSS 2.1 renderer written in Java. This artifact supports image output with the Java2D API.

There is a newer version: 1.0.10
Show newest version
package com.openhtmltopdf.java2d;

import com.openhtmltopdf.extend.FSObjectDrawer;
import com.openhtmltopdf.extend.OutputDevice;
import com.openhtmltopdf.extend.ReplacedElement;
import com.openhtmltopdf.java2d.api.Java2DRendererBuilder;
import com.openhtmltopdf.render.RenderingContext;
import org.w3c.dom.Element;

public class Java2DObjectDrawerReplacedElement extends Java2DRendererBuilder.Graphics2DPaintingReplacedElement
		implements ReplacedElement {
	private final Element e;
	private final int dotsPerPixel;
	private final FSObjectDrawer drawer;

	public Java2DObjectDrawerReplacedElement(Element e, FSObjectDrawer drawer, int width, int height,
			int dotsPerPixel) {
		super(width, height);
		this.e = e;
		this.drawer = drawer;
		this.dotsPerPixel = dotsPerPixel;
	}

	@Override
	public void paint(OutputDevice outputDevice, RenderingContext ctx, double x, double y, final double width,
			final double height) {
		drawer.drawObject(e, x, y, width, height, outputDevice, ctx, dotsPerPixel);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy