• 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Transform XML to RTF

Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?


Posts: 43028
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic