jQuery in Action, 2nd edition
The moose likes Swing / AWT / SWT / JFace and the fly likes JTextPane to BufferedImage Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "JTextPane to BufferedImage" Watch "JTextPane to BufferedImage" New topic
Author

JTextPane to BufferedImage

Martin Arrech
Greenhorn

Joined: Jan 17, 2012
Posts: 1
Hi everyone.
I'm maintaining a code of an application that prints stuff, like photos, text, in a pdf ready to get printed.
Now i have an annoying bug, the application converts text from a textpanel into a BufferedImage and save it to disk, but this image don't really represents what i see on screen.
Here's the code, I know it's a shame, but this code is not mine, I'm just maintaining it and fixing bugs



And then saves that image to disk

this is what i see on the app


this is what i get on image file (thumbnails don't work for png so, click on the image please)


in the second image, the text is cropped at right edge, very weird

Hope you can help me, before i get bald.
Sorry for my english
Hugs
 
 
subject: JTextPane to BufferedImage
 
Threads others viewed
Problem running Servlet
another kind of Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
Overwriting on a jpg in a Jpanel;
ConvolvedOp with / without alpha premultiplication
help GUI
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture