• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

RTF to PDF Conversion

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43024
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry ulf my bad it looks like it has one.
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic