public class Docx4J extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
Docx4J.FindContentControlsVisitor |
Modifier and Type | Field and Description |
---|---|
static int |
FLAG_BIND_BIND_XML
Insert the data of the xml in the content controls
Not needed, if the document will only be opened in word
and not converted to other formats.
|
static int |
FLAG_BIND_INSERT_XML
inject the passed xml into the document
if you don't do this step, then the xml in
the document will be used.
|
static int |
FLAG_BIND_REMOVE_SDT
Remove the content controls of the document
|
static int |
FLAG_BIND_REMOVE_XML
Remove any xml parts from the document that
are used with the content controls.
|
static int |
FLAG_EXPORT_PREFER_NONXSL
If available export the document using a visitor
|
static int |
FLAG_EXPORT_PREFER_XSL
If available export the document using a xsl transformation
|
static int |
FLAG_NONE
No flags passed, do the default
|
static int |
FLAG_SAVE_FLAT_XML
Save the document as a flat xml document
|
static int |
FLAG_SAVE_ZIP_FILE
Save the document in a zip container (default docx)
|
static String |
MIME_FO |
static String |
MIME_PDF |
protected static String |
NS_COMPONENTS |
protected static String |
NS_CONDITIONS |
protected static String |
NS_QUESTIONS |
protected static String |
NS_XPATHS |
protected static Set<String> |
PART_TO_REMOVE_SCHEMA_TYPES |
Constructor and Description |
---|
Docx4J() |
Modifier and Type | Method and Description |
---|---|
static void |
bind(WordprocessingMLPackage wmlPackage,
Document xmlDocument,
int flags)
Bind the content controls of the passed document to the xml.
|
static void |
bind(WordprocessingMLPackage wmlPackage,
InputStream xmlDocument,
int flags)
Bind the content controls of the passed document to the xml.
|
static void |
bind(WordprocessingMLPackage wmlPackage,
String xmlDocument,
int flags)
Bind the content controls of the passed document to the xml.
|
static WordprocessingMLPackage |
clone(WordprocessingMLPackage wmlPackage)
Duplicate the document
|
static FOSettings |
createFOSettings()
Create the configuration object for conversions that are done via xsl-fo
|
static HTMLSettings |
createHTMLSettings()
Create the configuration object for conversions to html
|
protected static String |
findXPathStorageItemIdInContentControls(WordprocessingMLPackage wmlPackage) |
protected static Exporter<FOSettings> |
getFOExporter(int flags) |
protected static Exporter<HTMLSettings> |
getHTMLExporter(int flags) |
protected static void |
insertXMLData(CustomXmlDataStoragePart customXmlDataStoragePart,
Document xmlDocument) |
static WordprocessingMLPackage |
load(File inFile)
Load a Docx Document from a File
|
static WordprocessingMLPackage |
load(InputStream inStream)
Load a Docx Document from an InputStream
|
static WordprocessingMLPackage |
load(PackageIdentifier pkgIdentifier,
File inFile)
Load a Docx Document from a File, assigning it an identifier for eventing
|
static WordprocessingMLPackage |
load(PackageIdentifier pkgIdentifier,
InputStream inStream)
Load a Docx Document from an InputStream, assigning it an identifier for eventing
|
protected static void |
removeDefinedCustomXmlParts(WordprocessingMLPackage wmlPackage,
CustomXmlDataStoragePart customXmlDataStoragePart) |
protected static void |
removeSDTs(WordprocessingMLPackage wmlPackage) |
static void |
save(WordprocessingMLPackage wmlPackage,
File outFile,
int flags)
Save a Docx Document to a File
|
static void |
save(WordprocessingMLPackage wmlPackage,
OutputStream outStream,
int flags)
Save a Docx Document to an OutputStream
|
static void |
setEventNotifier(net.engio.mbassy.bus.MBassador<Docx4jEvent> eventbus) |
static void |
toFO(FOSettings settings,
OutputStream outputStream,
int flags)
Convert the document via xsl-fo
|
static void |
toHTML(HTMLSettings settings,
OutputStream outputStream,
int flags)
Convert the document to HTML
|
static void |
toHTML(WordprocessingMLPackage wmlPackage,
String imageDirPath,
String imageTargetUri,
OutputStream outputStream)
Convert the document to HTML
|
static void |
toPDF(WordprocessingMLPackage wmlPackage,
OutputStream outputStream)
Convenience method to convert the document to PDF
|
public static final String MIME_PDF
public static final String MIME_FO
public static final int FLAG_NONE
public static final int FLAG_EXPORT_PREFER_XSL
public static final int FLAG_EXPORT_PREFER_NONXSL
public static final int FLAG_SAVE_ZIP_FILE
public static final int FLAG_SAVE_FLAT_XML
public static final int FLAG_BIND_INSERT_XML
public static final int FLAG_BIND_BIND_XML
public static final int FLAG_BIND_REMOVE_SDT
public static final int FLAG_BIND_REMOVE_XML
protected static final String NS_CONDITIONS
protected static final String NS_XPATHS
protected static final String NS_QUESTIONS
protected static final String NS_COMPONENTS
public static void setEventNotifier(net.engio.mbassy.bus.MBassador<Docx4jEvent> eventbus)
public static WordprocessingMLPackage load(File inFile) throws Docx4JException
Docx4JException
public static WordprocessingMLPackage load(PackageIdentifier pkgIdentifier, File inFile) throws Docx4JException
Docx4JException
public static WordprocessingMLPackage load(InputStream inStream) throws Docx4JException
Docx4JException
public static WordprocessingMLPackage load(PackageIdentifier pkgIdentifier, InputStream inStream) throws Docx4JException
Docx4JException
public static void save(WordprocessingMLPackage wmlPackage, File outFile, int flags) throws Docx4JException
Docx4JException
public static void save(WordprocessingMLPackage wmlPackage, OutputStream outStream, int flags) throws Docx4JException
Docx4JException
public static void bind(WordprocessingMLPackage wmlPackage, String xmlDocument, int flags) throws Docx4JException
Docx4JException
public static void bind(WordprocessingMLPackage wmlPackage, InputStream xmlDocument, int flags) throws Docx4JException
Docx4JException
public static void bind(WordprocessingMLPackage wmlPackage, Document xmlDocument, int flags) throws Docx4JException
Docx4JException
protected static void insertXMLData(CustomXmlDataStoragePart customXmlDataStoragePart, Document xmlDocument) throws Docx4JException
Docx4JException
protected static String findXPathStorageItemIdInContentControls(WordprocessingMLPackage wmlPackage)
protected static void removeSDTs(WordprocessingMLPackage wmlPackage) throws Docx4JException
Docx4JException
protected static void removeDefinedCustomXmlParts(WordprocessingMLPackage wmlPackage, CustomXmlDataStoragePart customXmlDataStoragePart)
public static WordprocessingMLPackage clone(WordprocessingMLPackage wmlPackage) throws Docx4JException
Docx4JException
public static FOSettings createFOSettings()
public static void toFO(FOSettings settings, OutputStream outputStream, int flags) throws Docx4JException
Docx4JException
public static void toPDF(WordprocessingMLPackage wmlPackage, OutputStream outputStream) throws Docx4JException
Docx4JException
protected static Exporter<FOSettings> getFOExporter(int flags)
public static HTMLSettings createHTMLSettings()
public static void toHTML(HTMLSettings settings, OutputStream outputStream, int flags) throws Docx4JException
Docx4JException
public static void toHTML(WordprocessingMLPackage wmlPackage, String imageDirPath, String imageTargetUri, OutputStream outputStream) throws Docx4JException
Docx4JException
protected static Exporter<HTMLSettings> getHTMLExporter(int flags)
Copyright © 2007-2014. All Rights Reserved.