File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes OpenOffice File Conversion formats Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "OpenOffice File Conversion formats" Watch "OpenOffice File Conversion formats" New topic
Author

OpenOffice File Conversion formats

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

Guys,

What are the file conversion formats does OpenOffice supports? Can I convert xml file to a pdf using OpenOffice??


SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32708
    
    4
Somebody else asked the same question recently: here.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

Yes, but the link does not say about how to convert the XML into PDF using OpenOffice. I even browsed through some of the content in the internet and not able to find any satisfactory answers...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35252
    
    7
Why not simply install OO and check out what it can do? I don't think that its API provides any functionality that the GUI doesn't, too.


Android appsImageJ pluginsJava web charts
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 8439

If you do not have this compulsion of using Open Office, scroll down to the link provided in the other post and check out FOP


[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

Ulf Dittmer wrote:Why not simply install OO and check out what it can do? I don't think that its API provides any functionality that the GUI doesn't, too.


I tried that and got an exception as below,

08.10.2009 11:14:31 com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection connect
INFO: connected
java.lang.IllegalArgumentException: unknown document format for file: C:\Dokumente und Einstellungen\Jothi\Desktop\page1.xml


Where page1.xml is the xml that I formed out of the first sheet of my Excel workbook.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32708
    
    4
You would have to parse the XML to find what it represents first, surely?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35252
    
    7
Jothi Shankar Kumar wrote:I tried that and got an exception as below,

What I meant is: Use its GUI (not its API) to see how it might be used to perform the conversion. Then automate that using the Java UNO API. This has nothing to do with JODConverter.

But I agree with Maneesh that for converting XML to PDF Apache FOP is probably a better choice.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

Yes, I do understand that. But the other problem is the XML file that I'm trying to convert is an intermediatory file. My original conversion has to be from Excel to PDF. This is just an alternate approach that I#m trying to do. But with the Apache FOP, I need an xsl which I do not have with my XML being converted using the JExcel API.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

I just have the DTD. Need to check if Apache FOP works with the DTD...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35252
    
    7
A DTD is not an XML file; FOP has no use for that. How do you think a DTD helps with a document conversion?

But with the Apache FOP, I need an xsl which I do not have

Correct, you'd need to create the XSL-FO stylesheet, but that's most likely less work than to use either the OO Java API, or the iText API.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

You mean with just my xml document which I got translated using the JExcel API, (which just has a DTD) I can generate a FOP XS?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35252
    
    7
No. Again, the DTD is not used during a document conversion. FOP transforms the XML into PDF using the XSL-FO stylesheet that *you* have created manually. This is all explained in detail -and with examples- on the FOP site.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

Might be I would just try that and get back here in case of any questions.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: OpenOffice File Conversion formats
 
Similar Threads
Convert .doc to .rtf
PowerPoint vs OpenOffice
file converting question
Convert Word to XML
Doc to Pdf conversion using Java Code