public class WordprocessingMLPackage extends OpcPackage
| Modifier and Type | Class and Description |
|---|---|
static class |
WordprocessingMLPackage.FilterSettings |
| Modifier and Type | Field and Description |
|---|---|
protected GlossaryDocumentPart |
glossaryDoc |
protected static org.slf4j.Logger |
log |
protected MainDocumentPart |
mainDoc |
contentTypeManager, customXmlDataStorageParts, docPropsCorePart, docPropsCustomPart, docPropsExtendedPart, externalResources, handled, partscontentType, partName, relationships| Constructor and Description |
|---|
WordprocessingMLPackage()
Constructor.
|
WordprocessingMLPackage(ContentTypeManager contentTypeManager)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
attachTemplate(String templatePath)
Attach a template to this document.
|
static WordprocessingMLPackage |
createPackage()
Creates a WordprocessingMLPackage, using default page size and orientation.
|
static WordprocessingMLPackage |
createPackage(PageSizePaper sz,
boolean landscape)
Creates a WordprocessingMLPackage, containing a MainDocumentPart (with content),
Styles part, DocPropsCorePart part, and DocPropsExtendedPart.
|
void |
filter(WordprocessingMLPackage.FilterSettings filterSettings)
Deprecated.
|
protected void |
finalize() |
DocumentModel |
getDocumentModel() |
Mapper |
getFontMapper() |
HeaderFooterPolicy |
getHeaderFooterPolicy()
Deprecated.
|
MainDocumentPart |
getMainDocumentPart() |
ProtectDocument |
getProtectionSettings() |
static WordprocessingMLPackage |
load(File docxFile)
Convenience method to create a WordprocessingMLPackage
from an existing File (.docx zip or .xml Flat OPC).
|
static WordprocessingMLPackage |
load(InputStream is)
Convenience method to create a WordprocessingMLPackage
from an existing stream(.docx zip or .xml Flat OPC).
|
void |
reset()
Reinit fields so this pkg object can be re-used.
|
void |
setFontMapper(Mapper fm) |
void |
setFontMapper(Mapper fm,
boolean populate) |
boolean |
setPartShortcut(Part part,
String relationshipType)
Tell the source Part about this target Part, so the
source can use this part via a convenience method.
|
void |
transform(Templates xslt,
Map<String,Object> transformParameters)
Use an XSLT to alter the contents of this package.
|
addDocPropsCorePart, addDocPropsCustomPart, addDocPropsExtendedPart, clone, cloneAs, getContentTypeManager, getCustomXmlDataStorageParts, getDocPropsCorePart, getDocPropsCustomPart, getDocPropsExtendedPart, getExternalResources, getPackage, getParts, getSourcePartStore, getTargetPartStore, getTitle, isNew, load, load, load, load, load, load, load, load, load, load, name, save, save, save, save, save, save, setContentTypeManager, setName, setNew, setSourcePartStore, setTargetPartStore, setTitleaddTargetPart, addTargetPart, addTargetPart, addTargetPart, getContentType, getPartName, getRelationshipsPart, getRelationshipsPart, getUserData, setContentType, setPartName, setRelationships, setUserDataprotected static org.slf4j.Logger log
protected MainDocumentPart mainDoc
protected GlossaryDocumentPart glossaryDoc
public WordprocessingMLPackage()
public WordprocessingMLPackage(ContentTypeManager contentTypeManager)
contentTypeManager - The content type manager to usepublic ProtectDocument getProtectionSettings()
public DocumentModel getDocumentModel()
@Deprecated public HeaderFooterPolicy getHeaderFooterPolicy()
public static WordprocessingMLPackage load(File docxFile) throws Docx4JException
docxFile - The docx fileDocx4JExceptionpublic static WordprocessingMLPackage load(InputStream is) throws Docx4JException
docxFile - The docx fileDocx4JExceptionpublic boolean setPartShortcut(Part part, String relationshipType)
BasesetPartShortcut in class OpcPackagepublic MainDocumentPart getMainDocumentPart()
public void transform(Templates xslt, Map<String,Object> transformParameters) throws Exception
is - transformParameters - Exception@Deprecated public void filter(WordprocessingMLPackage.FilterSettings filterSettings) throws Exception
Exceptionpublic void setFontMapper(Mapper fm, boolean populate) throws Exception
fm - populate - Exceptionpublic Mapper getFontMapper()
public static WordprocessingMLPackage createPackage() throws InvalidFormatException
InvalidFormatExceptionpublic static WordprocessingMLPackage createPackage(PageSizePaper sz, boolean landscape) throws InvalidFormatException
sz - landscape - InvalidFormatExceptionpublic void attachTemplate(String templatePath)
templatePath - protected void finalize()
throws Throwable
public void reset()
reset in class OpcPackageCopyright © 2007-2022. All Rights Reserved.