It's not a secret anymore!*
The moose likes Other Open Source Projects and the fly likes RTF to PDF Conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "RTF to PDF Conversion" Watch "RTF to PDF Conversion" New topic
Author

RTF to PDF Conversion

anish arora
Greenhorn

Joined: Nov 13, 2008
Posts: 4
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
Marshal

Joined: Mar 22, 2005
Posts: 41124
    
  45
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.


Ping & DNS - my free Android networking tools app
anish arora
Greenhorn

Joined: Nov 13, 2008
Posts: 4
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

Joined: Nov 13, 2008
Posts: 4
sorry ulf my bad it looks like it has one.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

That's interesting to know, that OO API sounds more useful than I originally thought!


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
anish arora
Greenhorn

Joined: Nov 13, 2008
Posts: 4
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

Joined: Dec 26, 2008
Posts: 1
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

Joined: Oct 22, 2009
Posts: 2
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: RTF to PDF Conversion
 
Similar Threads
Regarding APIs
Java API for RTF to DOCX Conversion
Create rtf document from a template
Tables
PDF to Editable Format(RTF/HTML) & back to PDF