|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDocument
Represents the MS Word Document.
Method Summary | |
---|---|
ListStyle |
addListStyle(ListType listType,
java.lang.String styleName)
Adds new list style to document. |
ParagraphStyle |
addParagraphStyle(java.lang.String styleName)
Adds new paragraph style to document. |
Section |
addSection()
Adds new section to document. |
Style |
addStyle(BuiltinStyle builtinStyle)
Adds the style to the document style. |
void |
createMinialDocument()
If the document contains no sections, creates one section with one paragraph. |
Paragraph |
createParagraph()
Creates the paragraph. |
Document |
deepClone()
Make deep copy of word document. |
void |
encrypt(java.lang.String password)
Encrypts the document. |
TextSelection[] |
findAllPattern(java.util.regex.Pattern pattern)
Finds and returns all entries of specified regular expression along with formatting. |
TextSelection[] |
findAllString(java.lang.String given,
boolean caseSensitive,
boolean wholeWord)
Finds and returns all entries of specified string along with formatting, taking into consideration caseSensitive and wholeWord options. |
TextSelection |
findPattern(BodyRegion startBodyItem,
java.util.regex.Pattern pattern)
Finds the next entry of matchString pattern. |
TextSelection |
findPattern(java.util.regex.Pattern pattern)
Finds and returns entry of specified regular expression along with formatting. |
TextSelection[] |
findPatternInLine(BodyRegion startBodyItem,
java.util.regex.Pattern pattern)
Finds the next text which fit the specified pattern starting from start BodyRegion using single-line mode. |
TextSelection[] |
findPatternInLine(java.util.regex.Pattern pattern)
Finds the first entry of specified pattern in single-line mode. |
TextSelection |
findString(BodyRegion startTextBodyItem,
java.lang.String given,
boolean caseSensitive,
boolean wholeWord)
Finds the next entry of matchString string, taking into consideration caseSensitive and wholeWord options. |
TextSelection |
findString(java.lang.String given,
boolean caseSensitive,
boolean wholeWord)
Finds and returns entry of specified string along with formatting, taking into consideration caseSensitive and wholeWord options. |
TextSelection[] |
findStringInLine(BodyRegion startTextBodyItem,
java.lang.String given,
boolean caseSensitive,
boolean wholeWord)
Finds the next matchString text starting from specified. |
TextSelection[] |
findStringInLine(java.lang.String given,
boolean caseSensitive,
boolean wholeWord)
Finds the first entry of matchString text in single-line mode. |
Background |
getBackground()
Gets background for the document. |
BookmarkCollection |
getBookmarks()
Gets collection of bookmarks of the document |
BuiltinDocumentProperties |
getBuiltinDocumentProperties()
Gets document's built-in properties. |
CommentsCollection |
getComments()
Gets Collection of Comments of the document. |
CustomDocumentProperties |
getCustomDocumentProperties()
Gets document's custom properties. |
Paragraph |
getLastParagraph()
Gets the last paragraph. |
Section |
getLastSection()
Gets last section object. |
ListStyleCollection |
getListStyles()
Gets collection of list styles. |
MailMerge |
getMailMerge()
Gets mail merge engine. |
DocumentProperties |
getProperties()
Gets the document properties. |
ProtectionType |
getProtectionType()
Gets the type of protection of the document. |
SectionCollection |
getSections()
Gets collection of sections of this document. |
StyleCollection |
getStyles()
Gets collection of styles. |
java.lang.String |
getText()
Gets the document's text. |
TextBoxCollection |
getTextBoxes()
Gets the textboxes of the document. |
TableOfContent |
getTOC()
Gets the TOC element of the document. |
VariableCollection |
getVariables()
Gets the document variables. |
ViewSetup |
getViewSetup()
Returns type in MSWord. |
WatermarkBase |
getWatermark()
Gets watermark for the document. |
boolean |
hasChanges()
Gets a value indicating whether the document has tracked changes. |
void |
importContent(IDocument doc)
Imports all content into the document. |
void |
importContent(IDocument doc,
boolean importStyles)
Imports all content into document. |
boolean |
isUpdateFields()
Gets a value indicating whether to update fields in the document. |
void |
isUpdateFields(boolean value)
Sets a value indicating whether to update fields in the document. |
void |
loadFromFile(java.lang.String fileName)
Opens the document from file in Microsoft Word format. |
void |
loadFromFile(java.lang.String fileName,
FileFormat fileFormat)
Opens the document from file in Xml or Microsoft Word format. |
void |
loadFromFileInReadMode(java.lang.String strFileName,
FileFormat fileFormat)
LoadFromStream new document in read-only mode. |
void |
loadFromStream(java.io.InputStream stream,
FileFormat fileFormat)
Opens the document from stream in Xml or Microsoft Word format. |
void |
protect(ProtectionType type)
Protects the document. |
void |
protect(ProtectionType type,
java.lang.String password)
Protects the document. |
void |
removeEncryption()
Removes the encryption. |
int |
replace(java.util.regex.Pattern pattern,
java.lang.String replace)
Replaces all occurrences of a character pattern specified by a regular expression with newValue string. |
int |
replace(java.util.regex.Pattern pattern,
TextSelection textSelection)
Replaces all entries of matchString regular expression with TextRangesHolder. |
int |
replace(java.lang.String given,
java.lang.String replace,
boolean caseSensitive,
boolean wholeWord)
Replaces all entries of matchString string with newValue string, taking into consideration caseSensitive and wholeWord options. |
int |
replace(java.lang.String given,
TextSelection textSelection,
boolean caseSensitive,
boolean wholeWord)
Replaces all entries of matchString string with TextSelection, taking into consideration caseSensitive and wholeWord options. |
int |
replaceInLine(java.util.regex.Pattern pattern,
java.lang.String replace)
Replaces all entries with specified pattern with newValue text in single-line mode. |
int |
replaceInLine(java.util.regex.Pattern pattern,
TextSelection replacement)
Replaces the matchString pattern with matchSelection in single-line mode. |
int |
replaceInLine(java.lang.String given,
java.lang.String replace,
boolean caseSensitive,
boolean wholeWord)
Replaces all entries of matchString text with newValue text in single-line mode. |
int |
replaceInLine(java.lang.String given,
TextSelection replacement,
boolean caseSensitive,
boolean wholeWord)
Replaces the matchString text with matchSelection in single-line mode. |
void |
resetFindState()
Resets the FindPattern. |
void |
saveToFile(java.io.OutputStream stream,
FileFormat fileFormat)
Saves the document to a stream in Xml or Microsoft Word format. |
void |
saveToFile(java.lang.String fileName)
Saves the document to file in Microsoft Word format. |
void |
saveToFile(java.lang.String fileName,
FileFormat fileFormat)
Saves the document to file in Xml or Microsoft Word format. |
java.awt.image.BufferedImage[] |
saveToImages(ImageType type)
Converts the whole document into images Layouting of the pages is not exactly the same as the layouting made by Microsoft Word. |
java.awt.image.BufferedImage |
saveToImages(int pageIndex,
ImageType type)
Converts the specified page into image. |
java.awt.image.BufferedImage[] |
saveToImages(int pageIndex,
int noOfPages,
ImageType type)
Converts the specified range of pages into images Layouting of the pages is not exactly the same as the layouting made by MS-Word. |
void |
setProtectionType(ProtectionType value)
Sets the type of protection of the document. |
void |
setTOC(TableOfContent value)
Sets the TOC element of the document. |
void |
setWatermark(WatermarkBase value)
Sets watermark for the document. |
void |
updateWordCount()
Update Paragraphs count, Word count and Character count |
Methods inherited from interface com.spire.doc.interfaces.ICompositeObject |
---|
getChildObjects |
Methods inherited from interface com.spire.doc.interfaces.IDocumentObject |
---|
getDocument, getDocumentObjectType, getNextSibling, getOwner, getPreviousSibling, isComposite |
Method Detail |
---|
BuiltinDocumentProperties getBuiltinDocumentProperties()
CustomDocumentProperties getCustomDocumentProperties()
SectionCollection getSections()
StyleCollection getStyles()
ListStyleCollection getListStyles()
BookmarkCollection getBookmarks()
TextBoxCollection getTextBoxes()
TableOfContent getTOC()
void setTOC(TableOfContent value)
value
- TableOfContentCommentsCollection getComments()
Section getLastSection()
Paragraph getLastParagraph()
ProtectionType getProtectionType()
void setProtectionType(ProtectionType value)
value
- ProtectionTypeViewSetup getViewSetup()
WatermarkBase getWatermark()
void setWatermark(WatermarkBase value)
value
- WatermarkBaseMailMerge getMailMerge()
Background getBackground()
VariableCollection getVariables()
DocumentProperties getProperties()
boolean hasChanges()
boolean isUpdateFields()
void isUpdateFields(boolean value)
value
- if update fields, set to truevoid createMinialDocument()
Section addSection()
ParagraphStyle addParagraphStyle(java.lang.String styleName)
styleName
- paragraph style name
ListStyle addListStyle(ListType listType, java.lang.String styleName)
listType
- type of the list style.styleName
- list style name
java.lang.String getText()
java.awt.image.BufferedImage[] saveToImages(ImageType type)
type
- the ImageType
java.awt.image.BufferedImage saveToImages(int pageIndex, ImageType type)
pageIndex
- zero based page indextype
- the ImageType
java.awt.image.BufferedImage[] saveToImages(int pageIndex, int noOfPages, ImageType type)
pageIndex
- starting page index (Zero based)noOfPages
- number of pagestype
- the ImageType
Paragraph createParagraph()
Document deepClone()
deepClone
in interface IDocumentObject
Style addStyle(BuiltinStyle builtinStyle)
builtinStyle
- the built-in style.
void protect(ProtectionType type)
type
- the type of the protection.void protect(ProtectionType type, java.lang.String password)
type
- the type of the protectionpassword
- the password used for protection.void encrypt(java.lang.String password)
password
- the passwordvoid removeEncryption()
void updateWordCount()
TextSelection findPattern(java.util.regex.Pattern pattern)
pattern
- pattern
TextSelection findString(java.lang.String given, boolean caseSensitive, boolean wholeWord)
given
- givencaseSensitive
- caseSensitivewholeWord
- wholeWord
TextSelection[] findPatternInLine(java.util.regex.Pattern pattern)
pattern
- the pattern.
TextSelection[] findStringInLine(java.lang.String given, boolean caseSensitive, boolean wholeWord)
given
- the string to find.caseSensitive
- if it specifies case sensitive, set to truewholeWord
- if it specifies to search a whole word, set to true
TextSelection[] findAllPattern(java.util.regex.Pattern pattern)
pattern
- pattern
TextSelection[] findAllString(java.lang.String given, boolean caseSensitive, boolean wholeWord)
given
- givencaseSensitive
- caseSensitivewholeWord
- wholeWord
int replace(java.util.regex.Pattern pattern, java.lang.String replace)
pattern
- patternreplace
- replace
int replace(java.lang.String given, java.lang.String replace, boolean caseSensitive, boolean wholeWord)
given
- givenreplace
- replacecaseSensitive
- caseSensitivewholeWord
- wholeWord
int replace(java.util.regex.Pattern pattern, TextSelection textSelection)
pattern
- the pattern.textSelection
- the text selection.
int replace(java.lang.String given, TextSelection textSelection, boolean caseSensitive, boolean wholeWord)
given
- the matchString.textSelection
- the text selection.caseSensitive
- if it specifies case sensitive, set to truewholeWord
- if it specifies to search whole word, set to true
int replaceInLine(java.lang.String given, java.lang.String replace, boolean caseSensitive, boolean wholeWord)
given
- the matchString.replace
- the newValue.caseSensitive
- if it specifies case sensitive, set to truewholeWord
- if it specifies whole word to be newValue, set to true
int replaceInLine(java.util.regex.Pattern pattern, java.lang.String replace)
pattern
- the pattern.replace
- the newValue.
int replaceInLine(java.lang.String given, TextSelection replacement, boolean caseSensitive, boolean wholeWord)
given
- the matchString.replacement
- the matchSelection.caseSensitive
- if it specifies case sensitive newValue, set to truewholeWord
- if it specifies whole word to be newValue, set to true
int replaceInLine(java.util.regex.Pattern pattern, TextSelection replacement)
pattern
- the pattern.replacement
- the matchSelection.
TextSelection findString(BodyRegion startTextBodyItem, java.lang.String given, boolean caseSensitive, boolean wholeWord)
startTextBodyItem
- the text body item at which search starts (paragraph or table)given
- the string to find.caseSensitive
- if it specifies case sensitive search, set to truewholeWord
- if it specifies whole word to be search, set to true
TextSelection findPattern(BodyRegion startBodyItem, java.util.regex.Pattern pattern)
startBodyItem
- the start body item at which search starts (paragraph or table).pattern
- the pattern.
TextSelection[] findStringInLine(BodyRegion startTextBodyItem, java.lang.String given, boolean caseSensitive, boolean wholeWord)
startTextBodyItem
- the start text body item.given
- the matchString.caseSensitive
- if it specifies case sensitive search, set to truewholeWord
- if it specifies whole word to be search, set to true
TextSelection[] findPatternInLine(BodyRegion startBodyItem, java.util.regex.Pattern pattern)
startBodyItem
- the start body item.pattern
- the pattern.
void resetFindState()
void loadFromStream(java.io.InputStream stream, FileFormat fileFormat)
stream
- The input streamfileFormat
- The file formatvoid saveToFile(java.io.OutputStream stream, FileFormat fileFormat)
stream
- The output streamfileFormat
- The file formatvoid loadFromFile(java.lang.String fileName)
fileName
- file namevoid loadFromFile(java.lang.String fileName, FileFormat fileFormat)
fileName
- fileNamefileFormat
- fileformatvoid loadFromFileInReadMode(java.lang.String strFileName, FileFormat fileFormat)
strFileName
- file to open.fileFormat
- type of the format.void saveToFile(java.lang.String fileName)
fileName
- file namevoid saveToFile(java.lang.String fileName, FileFormat fileFormat)
fileName
- file namefileFormat
- type of the formatvoid importContent(IDocument doc)
doc
- the doc.void importContent(IDocument doc, boolean importStyles)
doc
- the doc.importStyles
- if the document styles which have same names will be
also imported to the destination document, set to true
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |