Hi,
May I know whether we can print the content which is inside a scrollpane (although some portion of the content is out of viewable screen size) to printer?
The way printing works when using Graphics2D objects, as far as I know, is that you can only print using the visible part of the Graphics device. I believe this is because only the viewbale area is rendered at any one time - no point in using up memory rendering an area which you cannot see !
So, you must either make the the non-viewbale scrollpane area viewable, and print it that way, or use another API to extract the data from the Graphics device, and transform this to some other format so you can print it.
You may want to look at Batik and/or Cocoon which renders Graphics devices to SVG, and FOP which can create PDFs from several formats.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.