File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java API to Convert DOCX files to RTF or to XSL

 
Agustin Ernesto Cardeilhac Banus
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • 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...
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankx Ulf !. I'll be checking out that and posting back... Cheers
 
Agustin Ernesto Cardeilhac Banus
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • 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
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Paul Clapham
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah... Me too got confused... I tried other API's but didn't succeed !
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is OpenOffice actually running on port 7101?
 
Paul Clapham
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic