Java2d fast renderer plus fix output device#521
Merged
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.
Owner
Author
|
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:
|
Contributor
|
wow, with this cleanup I guess that some enum values used in the logger could be removed. I'll have a look this week :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Finally.
This will allow us to remove the slow renderer in a version or two.