aspose file tools*
The moose likes Other Open Source Projects and the fly likes Java API to Convert DOCX files to RTF or to XSL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Java API to Convert DOCX files to RTF or to XSL" Watch "Java API to Convert DOCX files to RTF or to XSL" New topic
Author

Java API to Convert DOCX files to RTF or to XSL

Agustin Ernesto Cardeilhac Banus
Greenhorn

Joined: Jan 23, 2013
Posts: 9
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
Marshal

Joined: Mar 22, 2005
Posts: 41867
    
  63
Check out the JODConverter library - it uses OpenOffice in server mode to convert between document formats. DOCX to RTF should be possible.


Ping & DNS - my free Android networking tools app
Agustin Ernesto Cardeilhac Banus
Greenhorn

Joined: Jan 23, 2013
Posts: 9
Thankx Ulf !. I'll be checking out that and posting back... Cheers
Agustin Ernesto Cardeilhac Banus
Greenhorn

Joined: Jan 23, 2013
Posts: 9
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
Marshal

Joined: Mar 22, 2005
Posts: 41867
    
  63
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

Joined: Jan 23, 2013
Posts: 9
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
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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

Joined: Jan 23, 2013
Posts: 9
I know... But I was thinking about the trace... Just to see what comes up... I am kinda stuck... This sucks !...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41867
    
  63
Why don't you post whatever stack trace or exception you're getting?
Agustin Ernesto Cardeilhac Banus
Greenhorn

Joined: Jan 23, 2013
Posts: 9
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
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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

Joined: Jan 23, 2013
Posts: 9
Yeah... Me too got confused... I tried other API's but didn't succeed !
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41867
    
  63
Is OpenOffice actually running on port 7101?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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
 
subject: Java API to Convert DOCX files to RTF or to XSL