File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issues with Graphics2D drawString method

 
Naga venkateswara Rao
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you save the image?
 
Naga venkateswara Rao
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic