This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RTF to PDF Conversion

 
anish arora
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I am trying to convert rtf document to pdf in my web application.I am using the RTFToolkit present in jdk swing for reading rtf.The problem is it is not able to read the table data properly in rtf file due to which the PDF document created is missing the table data.Is there any to do it ?

I am doing as follows

read rtf (using rtftoolkit) --> construct a pdf using apache FOP or iText.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

I doubt that RTFToolkit supports anything close to the full range of RTF features. Aside from rolling your own RTF reader (it's not that hard to create a lexer for RTF) which then creates PDF, you could check out OpenOffice's server mode. It has a Java API you could use to have it open an RTF file, and then save that as PDF.
 
anish arora
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf

I checked the open office converter api it says we can convert from ms word,excel or ppt to any of PDF,RTF etc but not from RTF to PDF.The RTF Conversion looks little bit tricky do you have any other suggestions ?

Thanks
Anish
 
anish arora
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry ulf my bad it looks like it has one.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's interesting to know, that OO API sounds more useful than I originally thought!
 
anish arora
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,

I tried with the Open office converter but looks like the application is not scalable for my current application(environment problems)I tried with different api's which convert rtf to xsl-fo and from there to pdf using apache fop.but still my table strutures are scrambled up.are you aware of any open source api's which are helpful ?Can you piont me to any resources which can help me read rtf tables.
 
Suresh Pagadala
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Suresh Pagadala:
[QB][/QB]


Hi Anish,

I found Open Office to be good enough for converting RTF to PDF format. However, you had mentioned that this is not scalable as per your environment. Could you please provide some additional information on this? What kind of scalability issues did you face?
Thanks in advance.
 
Dan Chirita
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

You can convert RTF to PDF using JODConverter (opensource, using openoffice in background)
I've never used it but it shouldn't be difficult to use.

Regards,
Dan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic