idocument-ag凯发旗舰厅



com.spire.doc.interfaces
interface idocument

all superinterfaces:
icompositeobject, idocumentobject
all known implementing classes:
document

public interface idocument
extends icompositeobject

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

getbuiltindocumentproperties

builtindocumentproperties getbuiltindocumentproperties()
gets document's built-in properties.
returns:
the built-in properties

getcustomdocumentproperties

customdocumentproperties getcustomdocumentproperties()
gets document's custom properties.
returns:
customdocumentproperties

getsections

sectioncollection getsections()
gets collection of sections of this document.
returns:
sectioncollection

getstyles

stylecollection getstyles()
gets collection of styles.
returns:
stylecollection

getliststyles

liststylecollection getliststyles()
gets collection of list styles.
returns:
liststylecollection

getbookmarks

bookmarkcollection getbookmarks()
gets collection of bookmarks of the document
returns:
bookmarkcollection

gettextboxes

textboxcollection gettextboxes()
gets the textboxes of the document.
returns:
textboxcollection

gettoc

tableofcontent gettoc()
gets the toc element of the document.
returns:
tableofcontent

settoc

void settoc(tableofcontent value)
sets the toc element of the document.
parameters:
value - tableofcontent

getcomments

commentscollection getcomments()
gets collection of comments of the document.
returns:
commentscollection

getlastsection

section getlastsection()
gets last section object.
returns:
section

getlastparagraph

paragraph getlastparagraph()
gets the last paragraph.
returns:
the last paragraph.

getprotectiontype

protectiontype getprotectiontype()
gets the type of protection of the document.
returns:
protectiontype

setprotectiontype

void setprotectiontype(protectiontype value)
sets the type of protection of the document.
parameters:
value - protectiontype

getviewsetup

viewsetup getviewsetup()
returns type in msword.
returns:
viewsetup

getwatermark

watermarkbase getwatermark()
gets watermark for the document.
returns:
watermarkbase

setwatermark

void setwatermark(watermarkbase value)
sets watermark for the document.
parameters:
value - watermarkbase

getmailmerge

mailmerge getmailmerge()
gets mail merge engine.
returns:
mailmerge

getbackground

background getbackground()
gets background for the document.
returns:
background

getvariables

variablecollection getvariables()
gets the document variables.
returns:
the variables.

getproperties

documentproperties getproperties()
gets the document properties.
returns:
the properties.

haschanges

boolean haschanges()
gets a value indicating whether the document has tracked changes.
returns:
if the document has tracked changes, set to true

isupdatefields

boolean isupdatefields()
gets a value indicating whether to update fields in the document. on the moment only docvariable fields can be updated.
returns:
if update fields, set to true

isupdatefields

void isupdatefields(boolean value)
sets a value indicating whether to update fields in the document. on the moment only docvariable fields can be updated.
parameters:
value - if update fields, set to true

createminialdocument

void createminialdocument()
if the document contains no sections, creates one section with one paragraph.

addsection

section addsection()
adds new section to document.
returns:
section

addparagraphstyle

paragraphstyle addparagraphstyle(java.lang.string stylename)
adds new paragraph style to document.
parameters:
stylename - paragraph style name
returns:
paragraphstyle

addliststyle

liststyle addliststyle(listtype listtype,
                       java.lang.string stylename)
adds new list style to document.
parameters:
listtype - type of the list style.
stylename - list style name
returns:
liststyle

gettext

java.lang.string gettext()
gets the document's text.
returns:
string

savetoimages

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. the total number of pages and layouting of the elements may vary.
parameters:
type - the imagetype
returns:
the bufferedimages

savetoimages

java.awt.image.bufferedimage savetoimages(int pageindex,
                                          imagetype type)
converts the specified page into image. layouting of the pages is not exactly the same as the layouting made by ms-word. the total number of pages and layouting of the elements may vary.
parameters:
pageindex - zero based page index
type - the imagetype
returns:
the bufferedimages

savetoimages

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. the total number of pages and layouting of the elements may vary.
parameters:
pageindex - starting page index (zero based)
noofpages - number of pages
type - the imagetype
returns:
the bufferedimages

createparagraph

paragraph createparagraph()
creates the paragraph.
returns:
the paragraph

deepclone

document deepclone()
make deep copy of word document.
specified by:
deepclone in interface idocumentobject
returns:
the new document

addstyle

style addstyle(builtinstyle builtinstyle)
adds the style to the document style.
parameters:
builtinstyle - the built-in style.
returns:
the style

protect

void protect(protectiontype type)
protects the document.
parameters:
type - the type of the protection.

protect

void protect(protectiontype type,
             java.lang.string password)
protects the document.
parameters:
type - the type of the protection
password - the password used for protection.

encrypt

void encrypt(java.lang.string password)
encrypts the document.
parameters:
password - the password

removeencryption

void removeencryption()
removes the encryption.

updatewordcount

void updatewordcount()
update paragraphs count, word count and character count

findpattern

textselection findpattern(java.util.regex.pattern pattern)
finds and returns entry of specified regular expression along with formatting.
parameters:
pattern - pattern
returns:
textselection

findstring

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.
parameters:
given - given
casesensitive - casesensitive
wholeword - wholeword
returns:
textselection

findpatterninline

textselection[] findpatterninline(java.util.regex.pattern pattern)
finds the first entry of specified pattern in single-line mode.
parameters:
pattern - the pattern.
returns:
array of textselection

findstringinline

textselection[] findstringinline(java.lang.string given,
                                 boolean casesensitive,
                                 boolean wholeword)
finds the first entry of matchstring text in single-line mode.
parameters:
given - the string to find.
casesensitive - if it specifies case sensitive, set to true
wholeword - if it specifies to search a whole word, set to true
returns:
array of textselection

findallpattern

textselection[] findallpattern(java.util.regex.pattern pattern)
finds and returns all entries of specified regular expression along with formatting.
parameters:
pattern - pattern
returns:
array of textselection

findallstring

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.
parameters:
given - given
casesensitive - casesensitive
wholeword - wholeword
returns:
array of textselection

replace

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.
parameters:
pattern - pattern
replace - replace
returns:
int

replace

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.
parameters:
given - given
replace - replace
casesensitive - casesensitive
wholeword - wholeword
returns:
int

replace

int replace(java.util.regex.pattern pattern,
            textselection textselection)
replaces all entries of matchstring regular expression with textrangesholder.
parameters:
pattern - the pattern.
textselection - the text selection.
returns:
int

replace

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.
parameters:
given - the matchstring.
textselection - the text selection.
casesensitive - if it specifies case sensitive, set to true
wholeword - if it specifies to search whole word, set to true
returns:
int

replaceinline

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.
parameters:
given - the matchstring.
replace - the newvalue.
casesensitive - if it specifies case sensitive, set to true
wholeword - if it specifies whole word to be newvalue, set to true
returns:
the number of performed replaces.

replaceinline

int replaceinline(java.util.regex.pattern pattern,
                  java.lang.string replace)
replaces all entries with specified pattern with newvalue text in single-line mode.
parameters:
pattern - the pattern.
replace - the newvalue.
returns:
the number of performed replaces.

replaceinline

int replaceinline(java.lang.string given,
                  textselection replacement,
                  boolean casesensitive,
                  boolean wholeword)
replaces the matchstring text with matchselection in single-line mode.
parameters:
given - the matchstring.
replacement - the matchselection.
casesensitive - if it specifies case sensitive newvalue, set to true
wholeword - if it specifies whole word to be newvalue, set to true
returns:
the number of performed replaces.

replaceinline

int replaceinline(java.util.regex.pattern pattern,
                  textselection replacement)
replaces the matchstring pattern with matchselection in single-line mode.
parameters:
pattern - the pattern.
replacement - the matchselection.
returns:
the number of performed replaces.

findstring

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.
parameters:
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 true
wholeword - if it specifies whole word to be search, set to true
returns:
textselection

findpattern

textselection findpattern(bodyregion startbodyitem,
                          java.util.regex.pattern pattern)
finds the next entry of matchstring pattern.
parameters:
startbodyitem - the start body item at which search starts (paragraph or table).
pattern - the pattern.
returns:
textselection

findstringinline

textselection[] findstringinline(bodyregion starttextbodyitem,
                                 java.lang.string given,
                                 boolean casesensitive,
                                 boolean wholeword)
finds the next matchstring text starting from specified. bodyregion using single-line mode.
parameters:
starttextbodyitem - the start text body item.
given - the matchstring.
casesensitive - if it specifies case sensitive search, set to true
wholeword - if it specifies whole word to be search, set to true
returns:
array of textselection

findpatterninline

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.
parameters:
startbodyitem - the start body item.
pattern - the pattern.
returns:
array of textselection

resetfindstate

void resetfindstate()
resets the findpattern.

loadfromstream

void loadfromstream(java.io.inputstream stream,
                    fileformat fileformat)
opens the document from stream in xml or microsoft word format.
parameters:
stream - the input stream
fileformat - the file format

savetofile

void savetofile(java.io.outputstream stream,
                fileformat fileformat)
saves the document to a stream in xml or microsoft word format.
parameters:
stream - the output stream
fileformat - the file format

loadfromfile

void loadfromfile(java.lang.string filename)
opens the document from file in microsoft word format.
parameters:
filename - file name

loadfromfile

void loadfromfile(java.lang.string filename,
                  fileformat fileformat)
opens the document from file in xml or microsoft word format.
parameters:
filename - filename
fileformat - fileformat

loadfromfileinreadmode

void loadfromfileinreadmode(java.lang.string strfilename,
                            fileformat fileformat)
loadfromstream new document in read-only mode.
parameters:
strfilename - file to open.
fileformat - type of the format.

savetofile

void savetofile(java.lang.string filename)
saves the document to file in microsoft word format.
parameters:
filename - file name

savetofile

void savetofile(java.lang.string filename,
                fileformat fileformat)
saves the document to file in xml or microsoft word format.
parameters:
filename - file name
fileformat - type of the format

importcontent

void importcontent(idocument doc)
imports all content into the document.
parameters:
doc - the doc.

importcontent

void importcontent(idocument doc,
                   boolean importstyles)
imports all content into document.
parameters:
doc - the doc.
importstyles - if the document styles which have same names will be also imported to the destination document, set to true


网站地图