-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java2d fast renderer plus fix output device #521
Conversation
With proofs in single page mode for all of our two Java2D tests.
Also removed unneeded casts in PagedBoxCollector while debugging.
Basic transforms and clipping are now working. However, mixed transforms and clipping is still not right.
Tests for linear gradient and clipping nested inside transforms without page margins.
Have to take account of page transform.
SVG and PNG.
With test for resized and repeating images.
Ah, feels good to mass delete.
EDIT: Wiki: Java2D Image Output now available. I think that completes the Java2D cleanup for now. Starting the wiki documentation draft below: UseThis example shows how to output to a continuous single page: Java2DRendererBuilder builder = new Java2DRendererBuilder();
builder.withHtmlContent(htmlString, baseUrlString);
builder.useFastMode();
BufferedImagePageProcessor bufferedImagePageProcessor = new BufferedImagePageProcessor(
BufferedImage.TYPE_INT_RGB, 1.0);
builder.toSinglePage(bufferedImagePageProcessor);
builder.useFont(new File("path/to/font.ttf"), "Fontname");
// Remember to set 'Fontname' as your font-family on the body element and any page margin boxes.
try {
builder.runFirstPage();
} catch (Exception e) {
System.err.println("Failed to render resource");
e.printStackTrace();
return null;
}
ImageIO.write(bufferedImagePageProcessor.getPageImages().get(0), "png", new FileOutputStream(...)); TODO: Multi page sample with DefaultPageProcessor here. LimitationsJava2D output does not currently support the following:
|
wow, with this cleanup I guess that some enum values used in the logger could be removed. I'll have a look this week :) |
Finally.
This will allow us to remove the slow renderer in a version or two.