aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Issues with Graphics2D drawString method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Issues with Graphics2D drawString method" Watch "Issues with Graphics2D drawString method" New topic
Author

Issues with Graphics2D drawString method

Naga venkateswara Rao
Greenhorn

Joined: Dec 16, 2009
Posts: 7
I has a image file on which i need to write user defined text. I am able to save the image with text written on it to a image file but when same output stream is directed to Jsp for displaying to user on fly the g.drawString text is visible but when saved to local machine as .jpg file the text goes missing. Also when the print option is selected on browser the image prints without the user defined text. Could any one help? The code is as follows:

ModifiedImage.java
-------------------------


A servlet that invokes this code and writes the image file to JSP
DisplayImage.java
-----------------------


The JSP file that uses this servlet is as follows
SampleImage.jsp
------------------------
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please UseCodeTags when posting code or configuration. Unformatted code and configuration is very difficult to read. You can edit your post to include them by using the button.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Do you save the image?
Naga venkateswara Rao
Greenhorn

Joined: Dec 16, 2009
Posts: 7
David Newton wrote:Do you save the image?


David,
We are not saving image instead we display the image on browser. When we checked it by printing image, we found user-text missing from the printed image.
We wanted to cross-examine this loss of string by saving the image using "Microsoft XPS Document Writer" option, and analyse what is being sent to printer (doubting that printer configuration might be the cause for problem/issue).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issues with Graphics2D drawString method