• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java API to Convert DOCX files to RTF or to XSL

 
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi !. I would like to know if there is a java lightweight api to convert docx template files into xsl or rtf files ?. The thing is that the place where I work, works for a credit card company where I need to generate pdf files base on the data from an excel file and a file template (in this case RTF). The new requirements are to be able to load docx file templates too... So I am googling but without success !... Hope I can manage throught this one...
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out the JODConverter library - it uses OpenOffice in server mode to convert between document formats. DOCX to RTF should be possible.
 
Agustin Ernesto Cardeilhac Banus
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thankx Ulf !. I'll be checking out that and posting back... Cheers
 
Agustin Ernesto Cardeilhac Banus
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ulf ?. This is my java test code in a simple web app...


Some seconds after pressing a button and getting executed this code, this strings appears in the log window from my JDeveloper IDE...
Am I doing the right thing ?...
 
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
No idea, I've never used the library. Empty catch blocks for I/O operations are a bad idea, though.

What is "this strings"?
 
Agustin Ernesto Cardeilhac Banus
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes... You are right... I paste on my actionlistener method and didn't realize... Anyway I think the exception or errors shows up onwards...
Which strings ?... The inputfile dir would be the file that the user uploads (not with the common file format -rtf- BUT WITH A DOCX file format) and the outputFile would be rtf file generated from the docx file...
Hope I made myself clear... Cheers
 
Marshal
Posts: 28177
95
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

Agustin Ernesto Cardeilhac Banus wrote:Anyway I think the exception or errors shows up onwards...



If you mean that you fixed your code by dealing with the exception in some useful way, then that's good. But if you mean that you think that if you ignore the error then some other code will deal with it, then no, that's not the case. Your original code caught the exception, so no other code will ever get to handle the exception.
 
Agustin Ernesto Cardeilhac Banus
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know... But I was thinking about the trace... Just to see what comes up... I am kinda stuck... This sucks !...
 
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
Why don't you post whatever stack trace or exception you're getting?
 
Agustin Ernesto Cardeilhac Banus
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After a while... I see this in the log window...

<AbstractOpenOfficeConnection> <disposing> disconnected unexpectedly

So I don't what's hapenning... Do you have a clue ?...
 
Paul Clapham
Marshal
Posts: 28177
95
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
I'm confused by these two lines of code which you posted:



What's the relationship between 8100 and 7101? Is there some computation you have to apply to 8100 to give you 7101 as the number to provide there?
 
Agustin Ernesto Cardeilhac Banus
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah... Me too got confused... I tried other API's but didn't succeed !
 
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
Is OpenOffice actually running on port 7101?
 
Paul Clapham
Marshal
Posts: 28177
95
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
What I'm trying to say here is... If you're going to put comments in your code, at least make them true statements. It's better to have no comment at all than to have a comment which is a lie.
 
reply
    Bookmark Topic Watch Topic
  • New Topic