Skip to content
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

Drop simple.Java2DRendererBuilder and implement single paged output #77

Conversation

rototor
Copy link
Contributor

@rototor rototor commented Mar 12, 2017

Drop the Java2DRendererBuilder in the core package and use the java2d
package. Also provide a BufferedImage PageProcessor.

Allow to output everything as single page. And adapt the testdriver to
use both modes.

Note: I am not sure if the output to file should be the DefaultPageProcessor. Everytime I need to output to an image using java2d I want to draw to

  • Another graphics2d
  • or a BufferedImage, which is then encoded and sent over network (as respone to a HTTP request)

So a default which write files somewhere seems "strange" for me. But as I can just change it, its no problem. I am not sure if the way I disabled the paging is the right one, but the output mostly seems sane (only the FSPageBreakMinHeightSample-sample seems strange in single page mode).

Drop the Java2DRendererBuilder in the core package and use the java2d
package. Also provide a BufferedImage PageProcessor.

Allow to output everything as single page. And adapt the testdriver to
use both modes.
rototor added a commit to rototor/openhtmltopdf that referenced this pull request Mar 12, 2017
Implement a default factory for FSObjectDrawer, which allows to
register custom drawers.

The testrunner includes a simple example how to implement
a FSObjectDrawer.

Currently its only possible with the PdfBoxRendererBuilder to register
a FSObjectDrawerFactory. As soon as danfickle#77 is merged I will implement
the same for Java2D.

This is the final feature I need to migrate all my reports
to OpenHtmlToPdf, as we do some custom graphs in some reports.
rototor added a commit to rototor/openhtmltopdf that referenced this pull request Mar 12, 2017
Implement a default factory for FSObjectDrawer, which allows to
register custom drawers.

The testrunner includes a simple example how to implement
a FSObjectDrawer.

Currently its only possible with the PdfBoxRendererBuilder to register
a FSObjectDrawerFactory. As soon as danfickle#77 is merged I will implement
the same for Java2D.

This is the final feature I need to migrate all my reports
to OpenHtmlToPdf, as we do some custom graphs in some reports.
@rototor rototor mentioned this pull request Mar 12, 2017
@danfickle
Copy link
Owner

Thanks again @rototor
You're really pushing this project along! As for the output stream supplier for default page processor, I thought most people would get the bytes using a byte array output stream, but you're right, I didn't think about those who need to post process a buffered image. We should probably rename the default page processor to reflect its output stream nature.

@danfickle danfickle merged commit 949c4a6 into danfickle:open-dev-v1 Mar 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants