File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert rtf File to jpg File

 
Steve Dyke
Ranch Hand
Posts: 1602
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way, using Java, to convert a rtf file to a jpg file on the fly?

My web app shares a set of files with a Windows app. The windows app displays the rtf in an ole box on a report when viewed.

I am using JasperReports to generate a PDF file for report viewing and printing. I cannot find a way to attach the rtf to the JasperReport. I know it can handle images so i thought that if I could convert rtf to jpg on the fly it might solve my issue. Right now at least on the view part I append a HyperLink to the rtf but this is not the users expectations.
 
Steve Dyke
Ranch Hand
Posts: 1602
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I sure could use some direction for this issue.
 
Jeremy Botha
Ranch Hand
Posts: 125
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RTF is a text format, isn't it?

About the only thing I can imagine you could do is use the java printing API to print to a PDF, and then convert the PDF to an image somehow.

But it seems like an incredibly round-about way to go about it.

Can you not access the data from which the RTF was generated?

J
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best I can think of is to display the RTF in a Swing component (the class is called RTFEditorKit), and then to take a screenshot using the Robot class. I'm not sure that that would work on a server, or that the screenshot would include the parts not visible in the Swing window, but it might be worth a try.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic