This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Transform XML to RTF 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 » Engineering » XML and Related Technologies
Bookmark "Transform XML to RTF" Watch "Transform XML to RTF" New topic
Author

Transform XML to RTF

Paulo Carvalho
Ranch Hand

Joined: Nov 12, 2008
Posts: 57
Hello

I have writed a little Java application that takes an XML + XSL, transform it to a new XML and finally, transforms it to a RTF.
It also takes the same XML source and transform it to a PDF.

To do the transformations, I use fop 0.95.

The PDF result is perfect, with all the informations and with a correct aligment/organization.

The RTF result is worse. Some informations are missing (like all the tables that are not showed), the aligment is wrong, blank pages are added, etc.

The code for generating a PDF and for generating an RTF is exactly the same except one line:

(for PDF generation)


(for RTF generation)


Am I doing something wrong?

Is there any other way/API that can be used to generate a correct RTF?

Thanks

Regards
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41123
    
  45
That probably (and it's just a guess, I've never used FOP for generating RTF) reflects the fact that PDF is by far the most widely used output format of FOP, and RTF -and possibly some of the other formats- linger somewhere between an afterthought and a neglected stepchild. From the FOP web site: "At the moment FOP is mainly a tool to render XSL-FO files to pdf.", and looking at the open issues for FOP's RTF functionality -some of which are several years old- I wouldn't get my hopes up that FOP's RTF support improves any time soon. However, anecdotal reports talk of "... render 7000 page RTF and PDF reports that contain continuous tables of over 20,000 records seamlessly (without page breaks in the table that are not at an end of page) without OOM errors.", so YMMV.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transform XML to RTF
 
Similar Threads
ServletOutputStream.write not working in IE 7
XSL-FO Multiple Page Sequences
Java : avalon framework configuration exception
Runtime exception while running the java application`
how to embed Asian font while genrating PDF using FOP