Converting to xlsx, pptx and docx formats

508 views
Skip to first unread message

Brian Hawkins

unread,
Nov 18, 2011, 2:21:07 PM11/18/11
to JODConverter
In case you have the desire to convert to xlsx, pptx or docx formats I
have figured out the filter names you can add to your format
registry. Below is some sample code to do it.


//Add export filter for docx
DocumentFormat docx = formatRegistry.getFormatByExtension("docx");
docx.setStoreProperties(DocumentFamily.TEXT,
Collections.singletonMap("FilterName", "MS Word 2007 XML"));

//Add export filter for xlsx
DocumentFormat xlsx = formatRegistry.getFormatByExtension("xlsx");
xlsx.setStoreProperties(DocumentFamily.SPREADSHEET,
Collections.singletonMap("FilterName", "Calc MS Excel 2007 XML"));

//Add export filter for pptx
DocumentFormat pptx = formatRegistry.getFormatByExtension("pptx");
pptx.setStoreProperties(DocumentFamily.PRESENTATION,
Collections.singletonMap("FilterName", "Impress MS PowerPoint 2007
XML"));

José Menezes

unread,
Mar 20, 2012, 10:36:48 AM3/20/12
to jodcon...@googlegroups.com
Hello, how to do this using the document-formats.js?

Today I am using Jod converter 3.0.4 but I am not changing on the java source-code...

Some pptx are converted, some are not.

Austin Dunham

unread,
Apr 26, 2013, 2:58:32 PM4/26/13
to jodcon...@googlegroups.com
Brian,
   Thank you, this is exactly what I needed.  Modified org/artofsolving/jodconverter/document/DefaultDocumentFormatRegistry.java, built it with maven(mvn), then simply took the resulting class file and put it back in the already compiled .jar.  (There may be a better was of totally rebuilding the .jar, but this at least worked.)

   Austin
Reply all
Reply to author
Forward
0 new messages