wood burning stoves 2.0*
The moose likes Java in General and the fly likes OpenOffice File Conversion formats Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
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: 9243
    
    1

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: 36508
    
  16
Somebody else asked the same question recently: here.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

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: 39548
    
  27
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.


Ping & DNS - updated with new look and Ping home screen widget
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

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


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

Joined: Sep 26, 2006
Posts: 9243
    
    1

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: 36508
    
  16
You would have to parse the XML to find what it represents first, surely?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
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: 9243
    
    1

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: 9243
    
    1

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

Joined: Mar 22, 2005
Posts: 39548
    
  27
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: 9243
    
    1

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: 39548
    
  27
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: 9243
    
    1

Might be I would just try that and get back here in case of any questions.
 
Don't get me started about those stupid light bulbs.
 
subject: OpenOffice File Conversion formats
 
Similar Threads
PowerPoint vs OpenOffice
file converting question
Convert .doc to .rtf
Convert Word to XML
Doc to Pdf conversion using Java Code