org.glox4j.samples.ParseGlox Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docx4j Show documentation
Show all versions of docx4j Show documentation
docx4j is a library which helps you to work with the Office Open
XML file format as used in docx
documents, pptx presentations, and xlsx spreadsheets.
package org.glox4j.samples;
import org.apache.log4j.Logger;
import org.docx4j.XmlUtils;
import org.docx4j.samples.AbstractSample;
import org.glox4j.openpackaging.packages.GloxPackage;
public class ParseGlox extends AbstractSample {
private static Logger log = Logger.getLogger(ParseGlox.class);
/**
* @param args
*/
public static void main(String[] args) throws Exception {
try {
getInputFilePath(args);
} catch (IllegalArgumentException e) {
// inputfilepath = System.getProperty("user.dir") + "/sample-docs/glox/Hier2Level.glox";
inputfilepath = System.getProperty("user.dir") + "/sample-docs/glox/Picture Organization Chart.glox";
}
GloxPackage gloxPackage = GloxPackage.load(new java.io.File(inputfilepath));
String title0 = gloxPackage.getDiagramLayoutHeaderPart().getJaxbElement().getTitle().get(0).getVal();
System.out.println("Title: " + title0);
String desc0 = gloxPackage.getDiagramLayoutHeaderPart().getJaxbElement().getDesc().get(0).getVal();
System.out.println("Description: " + desc0);
String layoutXml = XmlUtils.marshaltoString(gloxPackage.getDiagramLayoutPart().getJaxbElement() , true, true);
System.out.println(layoutXml);
}
}