Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • 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
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

Converting RTF to XSL-FO

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Everyone,
I am looking for a API which can convert a RTF file to XSL-FO file format.
Please give me a solution as early as possible.

I am currently exploring JFO API. Is there any one here who uses JFO for the same task?



Thank you all in advance.
 
Rajan Samraj
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone please tell me if it is possible or not at least? I need a solution as early as possible.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Converting RTF to XSL-FO doesn't really make sense. RTF files contain the text and pictures of a document, plus the its style information. XSL-FO contains no text, just instructions on how to format a document in the abstract. So what is it you're really trying to do?
 
Rajan Samraj
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Ulf Dittmer,

What you are saying is right.
Our requirement is in such a way that we have to find a solution to convert a RTF or DOC file to xml-fo.

We are actually doing this manually (Donkey's work) and storing it in one of the table column as CLOB column type. From this column our program will fetch the XSL-FO data and render it in to a PDF file using other API's. Hope this makes sense to you now.

Please give me your ideas if you have any.

Regards,
Rajan S
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, it still doesn't make sense to me. You've just repeated that you want to convert an RTF document to an XSL-FO document. I'll repeat that that makes no sense in the general case. What should happen to the text (and possibly images) in the RTF? XSL-FO makes no provisions for those. Should the contents go into an XML file, so that you can use the XSL-FO file to render it to some other format?

In RTF, every page can have a different style. That's generally not the case with XSL-FO files, which tend to have lots of repeated content. So how are your documents structured?

Knowing the answers to these questions would give us a better chance at helping you.
 
Rajan Samraj
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What should happen to the text (and possibly images) in the RTF?
A. The text in the RTF will be converted in to XSL-FO with the text only. Fortunately we don't have any images coming up in the RTF we get. So nothing to worry about images.

Should the contents go into an XML file, so that you can use the XSL-FO file to render it to some other format?
A. Yes, the MS word does the job of converting the RTF file in to an XML first and we use the MS office XSL plug-in and convert the XML file to an XSL-FO wiht the help of the XSL files from Microsoft. After this we use this XSL-FO data to create an PDF file by using some external API's Like Apache FOP.

Our requirement is very simple if you ask me.
The clients will give us some letters in RTF or DOC format. We have to just save this in the database. Our application has to convert this in to a PDF format and attach it with the other PDF documents and generate an output as one PDF file. Since XSL:FO is the general format to convert in to a PDF file we are converting the RTF file in to an XSL-FO format and converting in turn in to a PDF to get the output.

Regards,
Rajan S
 
Rajan Samraj
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ulf Dittmer,

Hope it gives you a clear picture of what exactly I am trying to get.
Please feel free to share your thoughts about the same.

Regards,
Rajan S
 
Marshal
Posts: 27900
94
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rajan Samraj:
Our requirement is very simple if you ask me.
The clients will give us some letters in RTF or DOC format. We have to just save this in the database. Our application has to convert this in to a PDF format and attach it with the other PDF documents and generate an output as one PDF file.

Yes, that is straightforward. You have an RTF document and you want to convert it to a PDF document.

Since XSL:FO is the general format to convert in to a PDF file we are converting the RTF file in to an XSL-FO format and converting in turn in to a PDF to get the output.

This is where I lost track, too. I couldn't understand what the purpose of the intermediate XSL-FO step was. If you need to convert RTF to PDF, why not just convert straight to PDF? Converting to XSL-FO would be like converting your RTF to a Java program that produced a PDF file.
 
Rajan Samraj
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Paul Clapham,


quote:
This is where I lost track, too. I couldn't understand what the purpose of the intermediate XSL-FO step was. If you need to convert RTF to PDF, why not just convert straight to PDF? Converting to XSL-FO would be like converting your RTF to a Java program that produced a PDF file.

Hello


My application has to generate some reports based on some values dynamically and create these reports in PDF format.
The letters are all in the form of xsl-fo in one of the table columns. which were created by our team manually with the help of MS Word and the plug-in.
Now there is a new requirement where the client will come up with a new letter to be added to the same list. Now this new letter should also be saved in the same column in the form of xsl-fo to be picked up dynamically by our program and create a single pdf file along with the other previously generating files.



The clients want me to create a maintenance page in JSP to store the new letter in the same table column. Therefore I now have to just convert this RTF or DOC file in to a xsl-fo and save in the table column under the old list of records just by a click of a button.

Hope this makes easy to understand the work around.

Please let me know your thoughts about my requirement. I need to solve this issue at a high priority. Please do help me out.


Thank you,

Rajan S
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now things are getting clearer. You don't want to convert the RTF into an XSL-FO stylesheet (which doesn't contain text), you want to convert it into an XSL-FO document (which does contain text).

The JFO API you mentioned claims to do that. I'm not aware of any other API that does that, and certainly no open source one. Automating page layout in this manner is not an easy task.
 
I once met a man from Nantucket. He had a tiny ad
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic