• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Convert rtf File to jpg File  RSS feed

 
Ranch Hand
Posts: 1887
1
  • 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: 1887
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I sure could use some direction for this issue.
 
Ranch Hand
Posts: 125
  • 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
 
Rancher
Posts: 42975
76
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!