public class XWPFDocument extends POIXMLDocument implements Document, IBody
High(ish) level class for working with .docx files.
This class tries to hide some of the complexity of the underlying file format, but as it's not a mature and stable API yet, certain parts of the XML structure come through. You'll therefore almost certainly need to refer to the OOXML specifications from http://www.ecma-international.org/publications/standards/Ecma-376.htm at some point in your use.
POIXMLDocumentPart.RelationPart
Modifier and Type | Field and Description |
---|---|
protected java.util.List<IBodyElement> |
bodyElements |
protected java.util.List<XWPFChart> |
charts |
protected java.util.List<XWPFComment> |
comments |
protected java.util.List<XWPFSDT> |
contentControls |
protected XWPFEndnotes |
endnotes |
protected java.util.List<XWPFFooter> |
footers |
protected XWPFFootnotes |
footnotes |
protected java.util.List<XWPFHeader> |
headers |
protected java.util.List<XWPFHyperlink> |
hyperlinks |
protected XWPFNumbering |
numbering |
protected java.util.Map<java.lang.Long,java.util.List<XWPFPictureData>> |
packagePictures |
protected java.util.List<XWPFParagraph> |
paragraphs |
protected java.util.List<XWPFPictureData> |
pictures |
protected XWPFStyles |
styles |
protected java.util.List<XWPFTable> |
tables |
DOCUMENT_CREATOR, OLE_OBJECT_REL_TYPE, PACK_OBJECT_REL_TYPE
PICTURE_TYPE_BMP, PICTURE_TYPE_DIB, PICTURE_TYPE_EMF, PICTURE_TYPE_EPS, PICTURE_TYPE_GIF, PICTURE_TYPE_JPEG, PICTURE_TYPE_PICT, PICTURE_TYPE_PNG, PICTURE_TYPE_TIFF, PICTURE_TYPE_WMF, PICTURE_TYPE_WPG
Constructor and Description |
---|
XWPFDocument() |
XWPFDocument(java.io.InputStream is) |
XWPFDocument(OPCPackage pkg) |
Modifier and Type | Method and Description |
---|---|
XWPFEndnote |
addEndnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
Add a CTFtnEdn endnote to the document.
|
XWPFFootnote |
addFootnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
Add a CTFtnEdn footnote to the document.
|
java.lang.String |
addPictureData(byte[] pictureData,
int format) |
java.lang.String |
addPictureData(java.io.InputStream is,
int format) |
protected void |
commit()
commit and saves the document
|
XWPFChart |
createChart()
This method is used to create template for chart XML
no need to read MS-Word file and modify charts
|
XWPFChart |
createChart(int width,
int height)
This method is used to create template for chart XML
no need to read MS-Word file and modify charts
|
XWPFChart |
createChart(XWPFRun run,
int width,
int height) |
XWPFEndnote |
createEndnote()
Create a new end note and add it to the document.
|
XWPFEndnotes |
createEndnotes() |
XWPFFooter |
createFooter(HeaderFooterType type)
Create a footer of the given type
|
XWPFFootnote |
createFootnote()
Create a new footnote and add it to the document.
|
XWPFFootnotes |
createFootnotes()
Creates an empty footnotes element for the document if one does not already exist
|
XWPFHeader |
createHeader(HeaderFooterType type)
Create a header of the given type
|
XWPFHeaderFooterPolicy |
createHeaderFooterPolicy() |
XWPFNumbering |
createNumbering()
Creates an empty numbering if one does not already exist and sets the numbering member
|
XWPFParagraph |
createParagraph()
Appends a new paragraph to this document
|
XWPFStyles |
createStyles()
Creates an empty styles for the document if one does not already exist
|
XWPFTable |
createTable()
Create an empty table with one row and one column as default.
|
XWPFTable |
createTable(int rows,
int cols)
Create an empty table with a number of rows and cols specified
|
void |
createTOC() |
void |
enforceCommentsProtection()
Enforce the Comments protection.
In the documentProtection tag inside settings.xml file, it sets the value of enforcement to "1" (w:enforcement="1") and the value of edit to comments (w:edit="comments") sample snippet from settings.xml |
void |
enforceCommentsProtection(java.lang.String password,
HashAlgorithm hashAlgo)
Enforce the Comments protection.
sample snippet from settings.xml |
void |
enforceFillingFormsProtection()
Enforce the Filling Forms protection.
In the documentProtection tag inside settings.xml file, it sets the value of enforcement to "1" (w:enforcement="1") and the value of edit to forms (w:edit="forms") sample snippet from settings.xml |
void |
enforceFillingFormsProtection(java.lang.String password,
HashAlgorithm hashAlgo)
Enforce the Filling Forms protection.
sample snippet from settings.xml |
void |
enforceReadonlyProtection()
Enforces the readOnly protection.
In the documentProtection tag inside settings.xml file, it sets the value of enforcement to "1" (w:enforcement="1") and the value of edit to readOnly (w:edit="readOnly") sample snippet from settings.xml |
void |
enforceReadonlyProtection(java.lang.String password,
HashAlgorithm hashAlgo)
Enforces the readOnly protection with a password.
sample snippet from settings.xml |
void |
enforceTrackedChangesProtection()
Enforce the Tracked Changes protection.
In the documentProtection tag inside settings.xml file, it sets the value of enforcement to "1" (w:enforcement="1") and the value of edit to trackedChanges (w:edit="trackedChanges") sample snippet from settings.xml |
void |
enforceTrackedChangesProtection(java.lang.String password,
HashAlgorithm hashAlgo)
Enforce the Tracked Changes protection.
sample snippet from settings.xml |
void |
enforceUpdateFields()
Enforces fields update on document open (in Word).
|
java.util.List<PackagePart> |
getAllEmbeddedParts()
Get the document's embedded files.
|
java.util.List<XWPFPictureData> |
getAllPackagePictures() |
java.util.List<XWPFPictureData> |
getAllPictures()
Returns all Pictures, which are referenced from the document itself.
|
java.util.List<IBodyElement> |
getBodyElements()
returns an Iterator with paragraphs and tables
|
java.util.Iterator<IBodyElement> |
getBodyElementsIterator() |
java.util.List<XWPFChart> |
getCharts() |
XWPFComment |
getCommentByID(java.lang.String id) |
XWPFComment[] |
getComments() |
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDocument1 |
getDocument()
Returns the low level document base object
|
XWPFEndnote |
getEndnoteByID(int id) |
java.util.List<XWPFEndnote> |
getEndnotes()
Gets the list of end notes for the document.
|
boolean |
getEvenAndOddHeadings()
Returns the even-and-odd-headings setting
|
XWPFFooter |
getFooterArray(int pos) |
java.util.List<XWPFFooter> |
getFooterList() |
XWPFFootnote |
getFootnoteByID(int id) |
java.util.List<XWPFFootnote> |
getFootnotes() |
XWPFHeader |
getHeaderArray(int pos) |
XWPFHeaderFooterPolicy |
getHeaderFooterPolicy()
Returns the policy on headers and footers, which
also provides a way to get at them.
|
java.util.List<XWPFHeader> |
getHeaderList() |
XWPFHyperlink |
getHyperlinkByID(java.lang.String id) |
XWPFHyperlink[] |
getHyperlinks() |
XWPFParagraph |
getLastParagraph() |
boolean |
getMirrorMargins()
Returns the mirror margins setting
|
int |
getNextPicNameNumber(int format)
get the next free ImageNumber
|
XWPFNumbering |
getNumbering()
getNumbering
|
XWPFParagraph |
getParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP p)
get the paragraph with the CTP class p
|
XWPFParagraph |
getParagraphArray(int pos)
Returns the paragraph that of position pos
|
int |
getParagraphPos(int pos)
Look up the paragraph at the specified position in the body elements list
and return this paragraphs position in the paragraphs list
|
java.util.List<XWPFParagraph> |
getParagraphs()
Returns the paragraph(s) that holds
the text of the header or footer.
|
java.util.Iterator<XWPFParagraph> |
getParagraphsIterator() |
POIXMLDocumentPart |
getPart()
returns the Part, to which the body belongs, which you need for adding relationship to other parts
Actually it is needed of the class XWPFTableCell.
|
PackagePart |
getPartById(java.lang.String id)
Get the document part that's defined as the
given relationship of the core document.
|
BodyType |
getPartType()
get the PartType of the body, for example
DOCUMENT, HEADER, FOOTER, FOOTNOTE,
|
XWPFPictureData |
getPictureDataByID(java.lang.String blipID)
returns the PictureData by blipID
|
int |
getPosOfParagraph(XWPFParagraph p)
Get the position of the paragraph, within the list
of all the body elements.
|
int |
getPosOfTable(XWPFTable t)
Get the position of the table, within the list of
all the body elements.
|
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTStyles |
getStyle()
Returns the styles object used
|
XWPFStyles |
getStyles()
get Styles
|
XWPFTable |
getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl ctTbl)
get a table by its CTTbl-Object
|
XWPFTable |
getTableArray(int pos)
Returns the table at position pos
|
XWPFTableCell |
getTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell)
get the TableCell which belongs to the TableCell
|
int |
getTablePos(int pos)
get with the position of a table in the bodyelement array list
the position of this table in the table array list
|
java.util.List<XWPFTable> |
getTables()
Return the table(s) that holds the text
of the IBodyPart, for complex cases
where a paragraph isn't used.
|
java.util.Iterator<XWPFTable> |
getTablesIterator() |
java.lang.String |
getTblStyle(XWPFTable table) |
XWPFDocument |
getXWPFDocument()
Return XWPFDocument
|
long |
getZoomPercent()
Returns the current zoom factor in percent values, i.e.
|
XWPFParagraph |
insertNewParagraph(org.apache.xmlbeans.XmlCursor cursor)
Add a new paragraph at position of the cursor.
|
XWPFTable |
insertNewTbl(org.apache.xmlbeans.XmlCursor cursor)
inserts a new Table at the cursor position.
|
void |
insertTable(int pos,
XWPFTable table)
inserts an existing XWPFTable to the arrays bodyElements and tables
|
boolean |
isEnforcedCommentsProtection()
Verifies that the documentProtection tag in settings.xml file
specifies that the protection is enforced (w:enforcement="1") and that the kind of protection is comments (w:edit="comments") sample snippet from settings.xml |
boolean |
isEnforcedFillingFormsProtection()
Verifies that the documentProtection tag in settings.xml file
specifies that the protection is enforced (w:enforcement="1") and that the kind of protection is forms (w:edit="forms") sample snippet from settings.xml |
boolean |
isEnforcedProtection()
Verifies that the documentProtection tag in settings.xml file
specifies that the protection is enforced (w:enforcement="1") sample snippet from settings.xml |
boolean |
isEnforcedReadonlyProtection()
Verifies that the documentProtection tag in settings.xml file
specifies that the protection is enforced (w:enforcement="1") and that the kind of protection is readOnly (w:edit="readOnly") sample snippet from settings.xml |
boolean |
isEnforcedTrackedChangesProtection()
Verifies that the documentProtection tag in settings.xml file
specifies that the protection is enforced (w:enforcement="1") and that the kind of protection is trackedChanges (w:edit="trackedChanges") sample snippet from settings.xml |
boolean |
isEnforcedUpdateFields() |
boolean |
isTrackRevisions()
Check if revision tracking is turned on.
|
protected static OPCPackage |
newPackage()
Create a new WordProcessingML package and setup the default minimal content
|
protected void |
onDocumentCreate()
Create a new CTWorkbook with all values set to default
|
protected void |
onDocumentRead()
Fired when a package part is read
|
boolean |
removeBodyElement(int pos)
remove a BodyElement from bodyElements array list
|
boolean |
removeEndnote(int pos)
Remove the specified end note if present.
|
boolean |
removeFootnote(int pos)
Remove the specified footnote if present.
|
void |
removeProtectionEnforcement()
Remove protection enforcement.
In the documentProtection tag inside settings.xml file it sets the value of enforcement to "0" (w:enforcement="0") |
void |
setEvenAndOddHeadings(boolean enable)
Sets the even-and-odd-headings setting
|
void |
setMirrorMargins(boolean enable)
Sets the mirror margins setting
|
void |
setParagraph(XWPFParagraph paragraph,
int pos)
copies content of a paragraph to a existing paragraph in the list paragraphs at position pos
|
void |
setTable(int pos,
XWPFTable table)
Replace content of table in array tables at position pos with a
|
void |
setTrackRevisions(boolean enable)
Enable or disable revision tracking.
|
void |
setZoomPercent(long zoomPercent)
Set the zoom setting as percent value, i.e.
|
boolean |
validateProtectionPassword(java.lang.String password)
Validates the existing password
|
close, getAllEmbedds, getCorePart, getPackage, getProperties, getRelatedByType, load, openPackage, write
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommited, isCommitted, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, removeRelation, setCommited, setCommitted, toString
protected java.util.List<XWPFFooter> footers
protected java.util.List<XWPFHeader> headers
protected java.util.List<XWPFComment> comments
protected java.util.List<XWPFHyperlink> hyperlinks
protected java.util.List<XWPFParagraph> paragraphs
protected java.util.List<XWPFTable> tables
protected java.util.List<XWPFSDT> contentControls
protected java.util.List<IBodyElement> bodyElements
protected java.util.List<XWPFPictureData> pictures
protected java.util.Map<java.lang.Long,java.util.List<XWPFPictureData>> packagePictures
protected XWPFEndnotes endnotes
protected XWPFNumbering numbering
protected XWPFStyles styles
protected XWPFFootnotes footnotes
protected final java.util.List<XWPFChart> charts
public XWPFDocument(OPCPackage pkg) throws java.io.IOException
java.io.IOException
public XWPFDocument(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public XWPFDocument()
protected static OPCPackage newPackage()
protected void onDocumentRead() throws java.io.IOException
POIXMLDocumentPart
onDocumentRead
in class POIXMLDocumentPart
java.io.IOException
- a subclass may throw an IOException when a document is readprotected void onDocumentCreate()
onDocumentCreate
in class POIXMLDocumentPart
@Internal public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDocument1 getDocument()
public java.util.List<IBodyElement> getBodyElements()
getBodyElements
in interface IBody
IBody.getBodyElements()
public java.util.Iterator<IBodyElement> getBodyElementsIterator()
public java.util.List<XWPFParagraph> getParagraphs()
IBody
getParagraphs
in interface IBody
IBody.getParagraphs()
public java.util.List<XWPFTable> getTables()
IBody
getTables
in interface IBody
IBody.getTables()
public java.util.List<XWPFChart> getCharts()
public XWPFTable getTableArray(int pos)
IBody
getTableArray
in interface IBody
IBody.getTableArray(int)
public java.util.List<XWPFFooter> getFooterList()
public XWPFFooter getFooterArray(int pos)
public java.util.List<XWPFHeader> getHeaderList()
public XWPFHeader getHeaderArray(int pos)
public java.lang.String getTblStyle(XWPFTable table)
public XWPFHyperlink getHyperlinkByID(java.lang.String id)
public XWPFFootnote getFootnoteByID(int id)
public XWPFEndnote getEndnoteByID(int id)
public java.util.List<XWPFFootnote> getFootnotes()
public XWPFHyperlink[] getHyperlinks()
public XWPFComment getCommentByID(java.lang.String id)
public XWPFComment[] getComments()
public PackagePart getPartById(java.lang.String id)
public XWPFHeaderFooterPolicy getHeaderFooterPolicy()
public XWPFHeaderFooterPolicy createHeaderFooterPolicy()
public XWPFHeader createHeader(HeaderFooterType type)
type
- HeaderFooterType
enumXWPFHeader
public XWPFFooter createFooter(HeaderFooterType type)
type
- HeaderFooterType
enumXWPFFooter
@Internal public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTStyles getStyle() throws org.apache.xmlbeans.XmlException, java.io.IOException
org.apache.xmlbeans.XmlException
java.io.IOException
public java.util.List<PackagePart> getAllEmbeddedParts() throws OpenXML4JException
getAllEmbeddedParts
in class POIXMLDocument
OpenXML4JException
- if the embedded parts can't be determinedpublic int getParagraphPos(int pos)
pos
- The position of the relevant paragraph in the body elements
listpublic int getTablePos(int pos)
pos
- position of the table in the bodyelement array listpublic XWPFParagraph insertNewParagraph(org.apache.xmlbeans.XmlCursor cursor)
XmlCursor.TokenType.START
tag of an subelement
of the documents body. When this method is done, the cursor passed as
parameter points to the XmlCursor.TokenType.END
of the newly inserted paragraph.insertNewParagraph
in interface IBody
cursor
- The cursor-position where the new paragraph should be added.XWPFParagraph
object representing the newly inserted
CTP objectpublic XWPFTable insertNewTbl(org.apache.xmlbeans.XmlCursor cursor)
IBody
insertNewTbl
in interface IBody
public int getPosOfParagraph(XWPFParagraph p)
p
- The paragraph to findpublic int getPosOfTable(XWPFTable t)
t
- The table to findprotected void commit() throws java.io.IOException
commit
in class POIXMLDocumentPart
java.io.IOException
- a subclass may throw an IOException if the changes can't be committedpublic XWPFParagraph createParagraph()
public XWPFNumbering createNumbering()
public XWPFStyles createStyles()
public XWPFFootnotes createFootnotes()
@Internal public XWPFFootnote addFootnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
note
- CTFtnEnd to be added.XWPFFootnote
@Internal public XWPFEndnote addEndnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
note
- CTFtnEnd to be added.XWPFEndnote
public boolean removeBodyElement(int pos)
pos
- public void setParagraph(XWPFParagraph paragraph, int pos)
paragraph
- pos
- public XWPFParagraph getLastParagraph()
public XWPFTable createTable()
public XWPFTable createTable(int rows, int cols)
rows
- cols
- public void createTOC()
public void setTable(int pos, XWPFTable table)
pos
- table
- public boolean isEnforcedProtection()
<w:settings ... > <w:documentProtection w:edit="readOnly" w:enforcement="1"/>
public boolean isEnforcedReadonlyProtection()
<w:settings ... > <w:documentProtection w:edit="readOnly" w:enforcement="1"/>
public boolean isEnforcedFillingFormsProtection()
<w:settings ... > <w:documentProtection w:edit="forms" w:enforcement="1"/>
public boolean isEnforcedCommentsProtection()
<w:settings ... > <w:documentProtection w:edit="comments" w:enforcement="1"/>
public boolean isEnforcedTrackedChangesProtection()
<w:settings ... > <w:documentProtection w:edit="trackedChanges" w:enforcement="1"/>
public boolean isEnforcedUpdateFields()
public void enforceReadonlyProtection()
<w:settings ... > <w:documentProtection w:edit="readOnly" w:enforcement="1"/>
public void enforceReadonlyProtection(java.lang.String password, HashAlgorithm hashAlgo)
<w:documentProtection w:edit="readOnly" w:enforcement="1" w:cryptProviderType="rsaAES" w:cryptAlgorithmClass="hash" w:cryptAlgorithmType="typeAny" w:cryptAlgorithmSid="14" w:cryptSpinCount="100000" w:hash="..." w:salt="...." />
password
- the plaintext password, if null no password will be appliedhashAlgo
- the hash algorithm - only md2, m5, sha1, sha256, sha384 and sha512 are supported.
if null, it will default default to sha1public void enforceFillingFormsProtection()
<w:settings ... > <w:documentProtection w:edit="forms" w:enforcement="1"/>
public void enforceFillingFormsProtection(java.lang.String password, HashAlgorithm hashAlgo)
<w:documentProtection w:edit="forms" w:enforcement="1" w:cryptProviderType="rsaAES" w:cryptAlgorithmClass="hash" w:cryptAlgorithmType="typeAny" w:cryptAlgorithmSid="14" w:cryptSpinCount="100000" w:hash="..." w:salt="...." />
password
- the plaintext password, if null no password will be appliedhashAlgo
- the hash algorithm - only md2, m5, sha1, sha256, sha384 and sha512 are supported.
if null, it will default default to sha1public void enforceCommentsProtection()
<w:settings ... > <w:documentProtection w:edit="comments" w:enforcement="1"/>
public void enforceCommentsProtection(java.lang.String password, HashAlgorithm hashAlgo)
<w:documentProtection w:edit="comments" w:enforcement="1" w:cryptProviderType="rsaAES" w:cryptAlgorithmClass="hash" w:cryptAlgorithmType="typeAny" w:cryptAlgorithmSid="14" w:cryptSpinCount="100000" w:hash="..." w:salt="...." />
password
- the plaintext password, if null no password will be appliedhashAlgo
- the hash algorithm - only md2, m5, sha1, sha256, sha384 and sha512 are supported.
if null, it will default default to sha1public void enforceTrackedChangesProtection()
<w:settings ... > <w:documentProtection w:edit="trackedChanges" w:enforcement="1"/>
public void enforceTrackedChangesProtection(java.lang.String password, HashAlgorithm hashAlgo)
<w:documentProtection w:edit="trackedChanges" w:enforcement="1" w:cryptProviderType="rsaAES" w:cryptAlgorithmClass="hash" w:cryptAlgorithmType="typeAny" w:cryptAlgorithmSid="14" w:cryptSpinCount="100000" w:hash="..." w:salt="...." />
password
- the plaintext password, if null no password will be appliedhashAlgo
- the hash algorithm - only md2, m5, sha1, sha256, sha384 and sha512 are supported.
if null, it will default default to sha1public boolean validateProtectionPassword(java.lang.String password)
password
- public void removeProtectionEnforcement()
public void enforceUpdateFields()
NOTICES:
public boolean isTrackRevisions()
true
if revision tracking is turned onpublic void setTrackRevisions(boolean enable)
enable
- true
to turn on revision tracking, false
to turn off revision trackingpublic long getZoomPercent()
public void setZoomPercent(long zoomPercent)
zoomPercent
- A percent value denoting the zoom setting for this document.public boolean getEvenAndOddHeadings()
public void setEvenAndOddHeadings(boolean enable)
enable
- Set to true to turn on separate even and odd headings.public boolean getMirrorMargins()
public void setMirrorMargins(boolean enable)
enable
- Set to true to turn on mirror margins.public void insertTable(int pos, XWPFTable table)
insertTable
in interface IBody
pos
- table
- public java.util.List<XWPFPictureData> getAllPictures()
List
of XWPFPictureData
. The returned List
is unmodifiable. Use #apublic java.util.List<XWPFPictureData> getAllPackagePictures()
public java.lang.String addPictureData(byte[] pictureData, int format) throws InvalidFormatException
InvalidFormatException
public java.lang.String addPictureData(java.io.InputStream is, int format) throws InvalidFormatException
InvalidFormatException
public int getNextPicNameNumber(int format) throws InvalidFormatException
format
- InvalidFormatException
- If the format of the picture is not known.public XWPFPictureData getPictureDataByID(java.lang.String blipID)
blipID
- public XWPFNumbering getNumbering()
public XWPFStyles getStyles()
public XWPFParagraph getParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP p)
getParagraph
in interface IBody
p
- public XWPFTable getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl ctTbl)
getTable
in interface IBody
ctTbl
- IBody.getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl)
public java.util.Iterator<XWPFTable> getTablesIterator()
public java.util.Iterator<XWPFParagraph> getParagraphsIterator()
public XWPFParagraph getParagraphArray(int pos)
getParagraphArray
in interface IBody
IBody.getParagraphArray(int)
public POIXMLDocumentPart getPart()
getPart
in interface IBody
IBody.getPart()
public BodyType getPartType()
getPartType
in interface IBody
IBody.getPartType()
public XWPFTableCell getTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell)
getTableCell
in interface IBody
cell
- public XWPFDocument getXWPFDocument()
IBody
getXWPFDocument
in interface IBody
public XWPFChart createChart() throws InvalidFormatException, java.io.IOException
InvalidFormatException
java.io.IOException
public XWPFChart createChart(int width, int height) throws InvalidFormatException, java.io.IOException
width
- width of chart in documentheight
- height of chart in documentInvalidFormatException
java.io.IOException
public XWPFChart createChart(XWPFRun run, int width, int height) throws InvalidFormatException, java.io.IOException
run
- in which the chart will be attached.width
- in EMU.height
- in EMU.InvalidFormatException
java.io.IOException
public XWPFFootnote createFootnote()
public boolean removeFootnote(int pos)
pos
- Array position of the footnote to be removed.public XWPFEndnote createEndnote()
XWPFEndnote
.public XWPFEndnotes createEndnotes()
public java.util.List<XWPFEndnote> getEndnotes()
XWPFEndnote
s.public boolean removeEndnote(int pos)
pos
- Array position of the end note to be removed.Copyright 2020 The Apache Software Foundation or its licensors, as applicable.