public class XWPFSettings extends POIXMLDocumentPart
DEFAULT_XML_OPTIONS
Constructor and Description |
---|
XWPFSettings() |
XWPFSettings(PackagePart part,
PackageRelationship rel) |
Modifier and Type | Method and Description |
---|---|
protected void |
commit()
Save the content in the underlying package part.
|
long |
getZoomPercent()
Set zoom.
|
boolean |
isEnforcedWith(org.openxmlformats.schemas.wordprocessingml.x2006.main.STDocProtect.Enum editValue)
Verifies the documentProtection tag inside settings.xml file
if the protection is enforced (w:enforcement="1") and if the kind of protection equals to passed (STDocProtect.Enum editValue) sample snippet from settings.xml <w:settings ... |
protected void |
onDocumentRead()
Fired when a package part is read
|
void |
removeEnforcement()
Removes protection enforcement.
|
void |
setEnforcementEditValue(org.openxmlformats.schemas.wordprocessingml.x2006.main.STDocProtect.Enum editValue)
Enforces the protection with the option specified by passed editValue.
|
void |
setUpdateFields()
Enforces fields update on document open (in Word).
|
void |
setZoomPercent(long zoomPercent)
Set zoom.
|
addRelation, clearMemoryPackagePart, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationCounter, getRelationId, getRelations, getTargetPart, onDocumentCreate, onDocumentRemove, onSave, read, rebase, removeRelation, removeRelation, toString
public XWPFSettings(PackagePart part, PackageRelationship rel) throws java.io.IOException
java.io.IOException
public XWPFSettings()
protected void onDocumentRead() throws java.io.IOException
POIXMLDocumentPart
onDocumentRead
in class POIXMLDocumentPart
java.io.IOException
public long getZoomPercent()
<w:zoom w:percent="50" />
public void setZoomPercent(long zoomPercent)
<w:zoom w:percent="50" />
public boolean isEnforcedWith(org.openxmlformats.schemas.wordprocessingml.x2006.main.STDocProtect.Enum editValue)
<w:settings ... > <w:documentProtection w:edit="readOnly" w:enforcement="1"/>
public void setEnforcementEditValue(org.openxmlformats.schemas.wordprocessingml.x2006.main.STDocProtect.Enum editValue)
<w:settings ... > <w:documentProtection w:edit="[passed editValue]" w:enforcement="1"/>
public void removeEnforcement()
public void setUpdateFields()
protected void commit() throws java.io.IOException
POIXMLDocumentPart
protected void commit() throws IOException {
PackagePart part = getPackagePart();
OutputStream out = part.getOutputStream();
XmlObject bean = getXmlBean(); //the "model" which holds changes in memory
bean.save(out, DEFAULT_XML_OPTIONS);
out.close();
}
commit
in class POIXMLDocumentPart
java.io.IOException
Copyright © 2005-2010 Potix Corporation. All Rights Reserved.