aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTextPane to BufferedImage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTextPane to BufferedImage
 
Similar Threads
Overwriting on a jpg in a Jpanel;
help GUI
another kind of Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
Problem running Servlet
ConvolvedOp with / without alpha premultiplication