document-ag凯发旗舰厅



com.spire.doc
class document

java.lang.object
  extended by com.spire.doc.ownerholder
      extended by com.spire.doc.documents.xml.documentserializable
          extended by com.spire.doc.documentobject
              extended by com.spire.doc.documentbase
                  extended by com.spire.doc.documentcontainer
                      extended by com.spire.doc.document
all implemented interfaces:
icompositeobject, idocument, idocumentobject

public class document
extends documentcontainer
implements idocument

field summary
 bookmarklevelhandler bookmarklayout
          occurs when draw a bookmark.
 pagelayouthandler pagelayout
          occurs when creating a new page.
 updatefieldshandler updatefields
          occurs when update field.
 
constructor summary
  document()
          initializes a new instance of the document class.
protected document(document doc)
           
  document(java.io.inputstream stream)
          initializes a new instance of the document class from the stream.
  document(java.io.inputstream inputstream, fileformat type)
          initializes a new instance of the document class from the stream.
  document(java.io.inputstream inputstream, fileformat type, java.lang.string password)
          initializes a new instance of the document class from the stream of specified type protected with password.
  document(java.io.inputstream stream, fileformat type, xhtmlvalidationtype validationtype)
          initializes a new instance of the document class example:loading an existing word document.
  document(java.io.inputstream inputstream, java.lang.string password)
          initializes a new instance of the document class from the word document�s stream, which is protected with password.
  document(java.lang.string filename)
          initializes a new instance of the document class from word document.
  document(java.lang.string filename, fileformat type)
          initializes a new instance of the document class.
  document(java.lang.string filename, fileformat type, java.lang.string password)
          initializes a new instance of the document class from existing file of specified type protected with password.
  document(java.lang.string filename, fileformat type, xhtmlvalidationtype validationtype)
          initializes a new instance of the document class.
  document(java.lang.string filename, java.lang.string password)
          initializes a new instance of the document class from existing word document, which is protected with password.
 
method summary
 void acceptchanges()
          accepts changes tracked from the moment of last change acceptance.
 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 the document.
 section addsection()
          adds new section to document.
 style addstyle(builtinstyle builtinstyle)
          adds the style to the document style.
 void clearmacros()
          removes the macros from the document.
 void clonecompatibilityto(document destdoc)
          clones the current document compatibility to the destination document.
 void clonedefaultstyleto(document destdoc)
          clones the current document default style to the destination document.
 void clonethemesto(document destdoc)
          clones the current document theme style to the destination document.
 void close()
          closes this instance.
 void createminialdocument()
          create a minial document, one empty section to the document and one empty paragraph to created section.
 paragraph createparagraph()
          creates the paragraph.
 paragraphbase createparagraphitem(paragraphitemtype itemtype)
          creates new paragraph item instance.
 document deepclone()
          clones itself.
 void dispose()
          prerforms application-defined tasks associated with freeing,releasing, or resetting unmanaged resources.
 void encrypt(java.lang.string password)
          encrypts the document.
 textselection[] findallpattern(java.util.regex.pattern pattern)
          returns all entries of matchstring regex.
 textselection[] findallstring(java.lang.string matchstring, boolean casesensitive, boolean wholeword)
          returns all entries of matchstring string, taking into consideration casesensitive and wholeword options.
 textselection findpattern(bodyregion start, 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 start, java.util.regex.pattern pattern)
          finds the text which fit the specified pattern starting from start.
 textselection[] findpatterninline(java.util.regex.pattern pattern)
          finds the first entry of specified pattern in single-line mode.
 textselection findstring(bodyregion start, java.lang.string matchstring, boolean casesensitive, boolean wholeword)
          finds the next entry of matchstring string, taking into consideration casesensitive and wholeword options.
 textselection findstring(java.lang.string stringvalue, boolean casesensitive, boolean wholeword)
          finds and returns string along with formatting.
 textselection[] findstringinline(bodyregion start, java.lang.string matchstring, boolean casesensitive, boolean wholeword)
          finds the next matchstring text starting from specified using single-line mode.
 textselection[] findstringinline(java.lang.string given, boolean casesensitive, boolean wholeword)
          finds the first entry of matchstring text in single-line mode.
 background getbackground()
          gets document's background
 bookmarkcollection getbookmarks()
          gets document bookmarks.
 builtindocumentproperties getbuiltindocumentproperties()
          gets document built-in properties object.
 documentobjectcollection getchildobjects()
          gets the child entities.
 commentscollection getcomments()
          gets comments item of the document.
 customdocumentproperties getcustomdocumentproperties()
          gets document custom properties object.
 fileformat getdetectedformattype()
          returns the detected format type of the document which was loaded.
 documentobjecttype getdocumentobjecttype()
          gets the type of the document object.
 boolean getembedfontsinfile()
          gets a value indicating whether save fonts that are used in the document in the file.
 boolean getembedsystemfonts()
          gets a value indicating whether save system fonts that are used in the document in the file.
 footendnoteoptions getendnoteoptions()
          gets options that control numbering and positioning of endnotes in this document.
 java.util.list<footnote> getendnotes()
          gets document endnotes.
 fieldcollection getfields()
          gets fields of the documnet.
 footendnoteoptions getfootnoteoptions()
          gets options that control numbering and positioning of footnotes in this document.
 java.util.list<footnote> getfootnotes()
          gets document footnotes.
 java.lang.string gethtmlbaseurl()
          gets the base path which is used to convert the relative path to absolute path.
 boolean gethtmlcustomcomment()
          gets a value specifying whether parsing and writing comment of document in html.
 htmlexportoptions gethtmlexportoptions()
          gets the save options.
 java.util.list gethtmlidentifierpunctuations()
           
 boolean gethtmlsentenceidentifier()
          gets a value specifying whether to add identifier to a sentence when writing to html.
 boolean gethtmltrackchanges()
          gets a value specifying whether parsing and writing custom change_tracking html tags are supported.
 boolean getkeepsameformat()
          gets a value that indicates whether to keep same formatting when it is merged to other document.
 paragraph getlastparagraph()
          gets last section object.
 section getlastsection()
          gets last section of the document.
 liststylecollection getliststyles()
          gets document list styles.
 mailmerge getmailmerge()
          gets mail merge engine.
 int getpagecount()
          gets total number of pages for document.
 int getpagecountex()
          gets total number of pages for document.
 com.spire.ms.printing.printdocument getprintdocument()
           
 java.util.list<privatefontpath> getprivatefontlist()
          gets the private font list.
 documentproperties getproperties()
          gets the document properties.
 protectiontype getprotectiontype()
          gets the type of protection of the document.
 boolean getquitemode()
          gets whether is quite mode.
 boolean getreplacefirst()
          gets a value indicating whether need first replacing.
 sectioncollection getsections()
          gets document sections.
 stylecollection getstyles()
          gets document styles
 java.lang.string gettext()
          gets the document's text.
 textboxcollection gettextboxes()
          get textbox items of main document
 tableofcontent gettoc()
          gets the toc element of the word document.
 boolean gettrackchanges()
          gets a value indicating whether tracking changes is turn on.
 variablecollection getvariables()
          gets the document variables.
 viewsetup getviewsetup()
          gets view setup options in microsoft word.
 watermarkbase getwatermark()
          gets document's watermark.
 xhtmlvalidationtype getxhtmlvalidateoption()
          gets the html validate option.the default value is none.
 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.
 void importsection(isection section)
          imports section into document.
 void inserttextfromfile(java.lang.string filename, fileformat fileformat)
          insert text from a file.
 void inserttextfromstream(java.io.inputstream stream, fileformat fileformat)
          insert text from stream.
 boolean iscontainmacro()
          indicates whether the document has macros.
 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 doc file.
 void loadfromfile(java.lang.string filename, fileformat fileformat)
          opens the document from file in xml or microsoft word format.
 void loadfromfile(java.lang.string filename, fileformat fileformat, java.lang.string password)
          opens the document from file in xml or microsoft word format.
 void loadfromfile(java.lang.string filename, fileformat fileformat, xhtmlvalidationtype validationtype)
          opens the html document from stream .
 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 loadfromstream(java.io.inputstream stream, fileformat fileformat, java.lang.string password)
          opens the document from stream in xml or microsoft word format.
 void loadfromstream(java.io.inputstream stream, fileformat fileformat, xhtmlvalidationtype validationtype)
          opens the html document from stream .
 void loadrtf(java.io.inputstream stream)
          opens the rtf document from a stream.
 void loadrtf(java.io.inputstream stream, java.nio.charset.charset charset)
          opens the rtf document with specified encoding from a stream.
 void loadrtf(java.lang.string filename)
          opens the rtf document from a file.
 void loadrtf(java.lang.string filename, java.nio.charset.charset charset)
          opens the rtf document with specified encoding from a file.
 void loadtext(java.io.inputstream stream)
          opens the text document from a stream with default encoding utf-8.
 void loadtext(java.io.inputstream stream, java.nio.charset.charset charset)
          opens the text document with specified encoding from a stream.
 void loadtext(java.lang.string filename)
          opens the text document from a file with default encoding utf-8.
 void loadtext(java.lang.string filename, java.nio.charset.charset charset)
          opens the text document with specified encoding from a file.
 void protect(protectiontype type)
          protects the document.
 void protect(protectiontype type, java.lang.string password)
          protects the document.
 void rejectchanges()
          rejects changes tracked from the moment of last change acceptance.
 void removeencryption()
          removes the encryption.
 int replace(java.util.regex.pattern pattern, java.lang.string replace)
          replaces all entries of matchstring 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 matchstring, idocument matchdoc, boolean casesensitive, boolean wholeword)
          replaces the specified matchstring.
 int replace(java.lang.string matchstring, java.lang.string newvalue, 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 matchstring, 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 newvalue)
          replaces all entries with specified pattern with newvalue text in single-line mode.
 int replaceinline(java.util.regex.pattern pattern, textselection matchselection)
          replaces the matchstring pattern with matchselection in single-line mode.
 int replaceinline(java.lang.string matchstring, java.lang.string newvalue, boolean casesensitive, boolean wholeword)
          replaces all entries of matchstring text with newvalue text in single-line mode.
 int replaceinline(java.lang.string matchstring, textselection matchselection, boolean casesensitive, boolean wholeword)
          replaces the matchstring text with matchselection in single-line mode.
 void resetfindstate()
          resets the findpattern.
 void savetoepub(java.io.outputstream stream, docpicture coverimage)
          saves the epub document.
 void savetoepub(java.lang.string filename, docpicture coverimage)
          saves the epub document.
 void savetofile(java.io.outputstream stream, fileformat fileformat)
          saves the document into stream in xml or microsoft word format.
 void savetofile(java.lang.string filename)
          saves 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.
 void savetofile(java.lang.string filename, fileformat fileformat, byte[] certificatedata, java.lang.string securepassword)
          saves document to file and digitally sign, only doc and docx are supported.
 void savetofile(java.lang.string filename, fileformat fileformat, java.lang.string certificatepath, java.lang.string securepassword)
          saves document to file and digitally sign, only doc and docx are supported.
 void savetofile(java.lang.string filename, java.util.list embeddedfontnamelist)
          embedding fonts to pdf document.
 void savetofile(java.lang.string filename, topdfparameterlist paramlist)
          saves the document to pdf file.
 java.awt.image.bufferedimage[] savetoimages(imagetype type)
          save the whole document into images
 java.awt.image.bufferedimage savetoimages(int pageindex, imagetype type)
          save the specified page into image
 java.awt.image.bufferedimage[] savetoimages(int pageindex, int pagecount, imagetype type)
          save the specified range of pages into images
 void savetostream(java.io.outputstream stream, fileformat fileformat)
          saves the document into stream in xml or microsoft word format.
 void savetostream(java.io.outputstream stream, fileformat fileformat, byte[] certificatedata, java.lang.string securepassword)
          saves document to stream and digitally sign, only doc and docx are supported.
 void savetostream(java.io.outputstream stream, fileformat fileformat, java.lang.string certificatepath, java.lang.string securepassword)
          saves document to stream and digitally sign, only doc and docx are supported.
 void savetostream(java.io.outputstream stream, topdfparameterlist paramlist)
          embedding fonts to pdf document.
 void savetostream(com.spire.ms.system.io.stream stream, fileformat fileformat, byte[] certificatedata, java.lang.string securepassword)
          saves document to stream and digitally sign, only doc and docx are supported.
 java.util.list savetosvg()
          saves the svg.
 void savetosvg(java.lang.string filename)
          saves the svg.
 void savetotxt(java.lang.string filename, java.nio.charset.charset charset)
          saves to text document with specified encoding.
 void setembedfontsinfile(boolean value)
          sets a value indicating whether save fonts that are used in the document in the file.
 void setembedsystemfonts(boolean value)
          sets a value indicating whether save system fonts that are used in the document in the file.
 void sethtmlbaseurl(java.lang.string value)
          sets the base path which is used to convert the relative path to absolute path.
 void sethtmlcustomcomment(boolean value)
          sets a value specifying whether parsing and writing comment of document in html.
 void sethtmlidentifierpunctuations(java.util.list value)
          set the custom punctuation as sentence indentifier.
 void sethtmlsentenceidentifier(boolean value)
          sets a value specifying whether to add identifier to a sentence when writing to html.
 void sethtmltrackchanges(boolean value)
          sets a value specifying whether parsing and writing custom change_tracking html tags are supported.
 void setjpegquality(int value)
          sets the quality (q%) of the image of jpeg format, this property is only used for doc to pdf.
 void setkeepsameformat(boolean value)
          sets a value that indicates whether to keep same formatting when it is merged to other document.
 void setprotectiontype(protectiontype value)
          sets the type of protection of the document.
 void setquitemode(boolean value)
          sets whether is quite mode.
 void setreplacefirst(boolean value)
          sets a value indicating whether need first replacing.
 void settextboxes(textboxcollection value)
          set textbox items of main document
 void settoc(tableofcontent value)
          sets the toc element of the word document.
 void settrackchanges(boolean value)
          sets a value indicating whether tracking changes is turn on.
 void setwatermark(watermarkbase value)
          sets document's watermark.
 void setxhtmlvalidateoption(xhtmlvalidationtype value)
          sets the html validate option.the default value is none.
static byte[] sign(java.io.inputstream sourcestream, byte[] certificatedata, java.lang.string securepassword)
          create digitally signed word document.
static byte[] sign(java.io.inputstream sourcestream, java.lang.string certificatepath, java.lang.string securepassword)
          create digitally signed word document.
 void updatetableofcontents()
          update table of contents in the document.
 void updatetableofcontents(tableofcontent toc)
           
 void updatewordcount()
          update paragraphs count, word count and character count
 void updatewordcount(char[] splitchar)
          update paragraphs count, word count and character count.
 void updatewordcount(char[] splitchar, boolean includetbfnen)
          update paragraphs count, word count and character count.
 
methods inherited from class com.spire.doc.documentobject
getfirstchild, getlastchild, getnextsibling, getowner, getprevioussibling, iscomposite, tostring
 
methods inherited from class com.spire.doc.ownerholder
getdocument
 
methods inherited from interface com.spire.doc.interfaces.idocumentobject
getdocument, getnextsibling, getowner, getprevioussibling, iscomposite
 
field detail

bookmarklayout

public bookmarklevelhandler bookmarklayout
occurs when draw a bookmark.

pagelayout

public pagelayouthandler pagelayout
occurs when creating a new page.

updatefields

public updatefieldshandler updatefields
occurs when update field.
constructor detail

document

public document(java.lang.string filename)
initializes a new instance of the document class from word document. example:loading an existing word document. document doc = new document("sample.doc");
parameters:
filename - name of the file.

document

public document(java.lang.string filename,
                java.lang.string password)
initializes a new instance of the document class from existing word document, which is protected with password. example:loading an existing word document. document doc = new document("sample.doc", "password");
parameters:
filename - name of the file.
password - the password.

document

public document(java.lang.string filename,
                fileformat type)
initializes a new instance of the document class. example:loading an existing word document. document doc = new document("sample.docx", formattype.docx);
parameters:
filename - name of the file.
type - the type.

document

public document(java.lang.string filename,
                fileformat type,
                xhtmlvalidationtype validationtype)
initializes a new instance of the document class. example:loading an existing word document. document docsource1 = new document("sample.doc",formattype.doc,xhtmlvalidationtype.strict);
parameters:
filename - name of the file
type - the type of the opened document.
validationtype - the xhtml validation type.

document

public document(java.lang.string filename,
                fileformat type,
                java.lang.string password)
initializes a new instance of the document class from existing file of specified type protected with password. example:loading an existing word document. document docsource1 = new document("sample.doc",formattype.doc, "password");
parameters:
filename - name of the file.
type - the type.
password - the password.

document

public document(java.io.inputstream stream,
                fileformat type,
                xhtmlvalidationtype validationtype)
initializes a new instance of the document class example:loading an existing word document. stream file2 = new filestream(datapath, filemode.loadfromstream, fileaccess.read, fileshare.read); document docsource1 = new document(file2,formattype.doc,xhtmlvalidationtype.strict);
parameters:
stream - the file stream.
type - the type of the opened document.
validationtype - type of the validation.

document

public document()
initializes a new instance of the document class. example:a new document is created. document document = new document();

document

public document(java.io.inputstream stream)
initializes a new instance of the document class from the stream. example:stream file2 = new filestream(datapath, filemode.loadfromstream, fileaccess.read, fileshare.read); document docsource1 = new document(file2);
parameters:
stream - the stream.

document

public document(java.io.inputstream inputstream,
                fileformat type)
initializes a new instance of the document class from the stream. example:stream file2 = new filestream(datapath, filemode.loadfromstream, fileaccess.read, fileshare.read); document docsource1 = new document(file2, formattype.doc);
parameters:
inputstream - the inputstream.
type - the type.

document

public document(java.io.inputstream inputstream,
                java.lang.string password)
initializes a new instance of the document class from the word document�s stream, which is protected with password. example:stream file2 = new filestream(datapath, filemode.loadfromstream, fileaccess.read, fileshare.read); document docsource1 = new document(file2, "password");
parameters:
inputstream - the stream.
password - the password.

document

public document(java.io.inputstream inputstream,
                fileformat type,
                java.lang.string password)
initializes a new instance of the document class from the stream of specified type protected with password. example:stream file2 = new filestream(datapath, filemode.loadfromstream, fileaccess.read, fileshare.read); document docsource1 = new document(file2, formattype.doc, "password");
parameters:
inputstream - the stream.
type - the type.
password - the password.

document

protected document(document doc)
method detail

gettoc

public tableofcontent gettoc()
gets the toc element of the word document.
specified by:
gettoc in interface idocument
returns:
the table of content

settoc

public void settoc(tableofcontent value)
sets the toc element of the word document.
specified by:
settoc in interface idocument
parameters:
value - tableofcontent

getembedfontsinfile

public boolean getembedfontsinfile()
gets a value indicating whether save fonts that are used in the document in the file. only support for the docx file format.
returns:
boolean

setembedfontsinfile

public void setembedfontsinfile(boolean value)
sets a value indicating whether save fonts that are used in the document in the file. only support for the docx file format.
parameters:
value - boolean

getprivatefontlist

public java.util.list<privatefontpath> getprivatefontlist()
gets the private font list.
returns:
list of privatefontpath

getembedsystemfonts

public boolean getembedsystemfonts()
gets a value indicating whether save system fonts that are used in the document in the file.
returns:
boolean

setembedsystemfonts

public void setembedsystemfonts(boolean value)
sets a value indicating whether save system fonts that are used in the document in the file.
parameters:
value - boolean

gethtmlbaseurl

public java.lang.string gethtmlbaseurl()
gets the base path which is used to convert the relative path to absolute path.
returns:
string

sethtmlbaseurl

public void sethtmlbaseurl(java.lang.string value)
sets the base path which is used to convert the relative path to absolute path.
parameters:
value - string

gethtmltrackchanges

public boolean gethtmltrackchanges()
gets a value specifying whether parsing and writing custom change_tracking html tags are supported. supported html tag : insert / delete. supported html tag attribytes : data-username / data-time.
returns:
boolean

sethtmltrackchanges

public void sethtmltrackchanges(boolean value)
sets a value specifying whether parsing and writing custom change_tracking html tags are supported. supported html tag : insert / delete. supported html tag attribytes : data-username / data-time.
parameters:
value - boolean

gethtmlsentenceidentifier

public boolean gethtmlsentenceidentifier()
gets a value specifying whether to add identifier to a sentence when writing to html. writed html attribyte : sentence. writed html value of attribyte : start / end / (start,end).
returns:
boolean

sethtmlsentenceidentifier

public void sethtmlsentenceidentifier(boolean value)
sets a value specifying whether to add identifier to a sentence when writing to html. writed html attribyte : sentence. writed html value of attribyte : start / end / (start,end).
parameters:
value - boolean value

gethtmlcustomcomment

public boolean gethtmlcustomcomment()
gets a value specifying whether parsing and writing comment of document in html. supported html tag : span ,when the value of class attribute is comment supported html tag attribytes : data-comment / data-user / data-cid / data-date.
returns:
boolean

sethtmlcustomcomment

public void sethtmlcustomcomment(boolean value)
sets a value specifying whether parsing and writing comment of document in html. supported html tag : span ,when the value of class attribute is comment supported html tag attribytes : data-comment / data-user / data-cid / data-date.
parameters:
value - boolean value

gethtmlidentifierpunctuations

public java.util.list gethtmlidentifierpunctuations()

sethtmlidentifierpunctuations

public void sethtmlidentifierpunctuations(java.util.list value)
set the custom punctuation as sentence indentifier. full stop, qusetion mark, exclamatory mark are default values.
parameters:
value - list

getfootnotes

public java.util.list<footnote> getfootnotes()
gets document footnotes.
returns:
list

getendnotes

public java.util.list<footnote> getendnotes()
gets document endnotes.
returns:
list of footnote

getdocumentobjecttype

public documentobjecttype getdocumentobjecttype()
gets the type of the document object.
specified by:
getdocumentobjecttype in interface idocumentobject
specified by:
getdocumentobjecttype in class documentobject
returns:
documentobjecttype

getbuiltindocumentproperties

public builtindocumentproperties getbuiltindocumentproperties()
gets document built-in properties object.
specified by:
getbuiltindocumentproperties in interface idocument
returns:
builtindocumentproperties

getcustomdocumentproperties

public customdocumentproperties getcustomdocumentproperties()
gets document custom properties object.
specified by:
getcustomdocumentproperties in interface idocument
returns:
customdocumentproperties

getsections

public sectioncollection getsections()
gets document sections.
specified by:
getsections in interface idocument
returns:
sectioncollection

getstyles

public stylecollection getstyles()
gets document styles
specified by:
getstyles in interface idocument
returns:
stylecollection

getliststyles

public liststylecollection getliststyles()
gets document list styles.
specified by:
getliststyles in interface idocument
returns:
liststylecollection

getbookmarks

public bookmarkcollection getbookmarks()
gets document bookmarks.
specified by:
getbookmarks in interface idocument
returns:
bookmarkcollection

getfields

public fieldcollection getfields()
gets fields of the documnet.
returns:
fieldcollection

getcomments

public commentscollection getcomments()
gets comments item of the document.
specified by:
getcomments in interface idocument
returns:
commentscollection

gettextboxes

public textboxcollection gettextboxes()
get textbox items of main document
specified by:
gettextboxes in interface idocument
returns:
textboxcollection

settextboxes

public void settextboxes(textboxcollection value)
set textbox items of main document
parameters:
value - textboxcollection

getlastsection

public section getlastsection()
gets last section of the document.
specified by:
getlastsection in interface idocument
returns:
section

getlastparagraph

public paragraph getlastparagraph()
gets last section object.
specified by:
getlastparagraph in interface idocument
returns:
paragraph

getendnoteoptions

public footendnoteoptions getendnoteoptions()
gets options that control numbering and positioning of endnotes in this document.
returns:
footendnoteoptions

getfootnoteoptions

public footendnoteoptions getfootnoteoptions()
gets options that control numbering and positioning of footnotes in this document.
returns:
footendnoteoptions

getwatermark

public watermarkbase getwatermark()
gets document's watermark.
specified by:
getwatermark in interface idocument
returns:
watermarkbase

setwatermark

public void setwatermark(watermarkbase value)
sets document's watermark.
specified by:
setwatermark in interface idocument
parameters:
value - watermarkbase

getbackground

public background getbackground()
gets document's background
specified by:
getbackground in interface idocument
returns:
background

getmailmerge

public mailmerge getmailmerge()
gets mail merge engine.
specified by:
getmailmerge in interface idocument
returns:
the mail merge object.

getprotectiontype

public protectiontype getprotectiontype()
gets the type of protection of the document.
specified by:
getprotectiontype in interface idocument
returns:
protectiontype

setprotectiontype

public void setprotectiontype(protectiontype value)
sets the type of protection of the document.
specified by:
setprotectiontype in interface idocument
parameters:
value - protectiontype

getviewsetup

public viewsetup getviewsetup()
gets view setup options in microsoft word.
specified by:
getviewsetup in interface idocument
returns:
viewsetup

getquitemode

public boolean getquitemode()
gets whether is quite mode.
returns:
boolean

setquitemode

public void setquitemode(boolean value)
sets whether is quite mode.
parameters:
value - boolean

getchildobjects

public documentobjectcollection getchildobjects()
gets the child entities.
specified by:
getchildobjects in interface icompositeobject
specified by:
getchildobjects in class documentobject
returns:
the child entities

getxhtmlvalidateoption

public xhtmlvalidationtype getxhtmlvalidateoption()
gets the html validate option.the default value is none.
returns:
the html validate option.

setxhtmlvalidateoption

public void setxhtmlvalidateoption(xhtmlvalidationtype value)
sets the html validate option.the default value is none.
parameters:
value - the html validate option.

getvariables

public variablecollection getvariables()
gets the document variables.
specified by:
getvariables in interface idocument
returns:
the variables.

getproperties

public documentproperties getproperties()
gets the document properties.
specified by:
getproperties in interface idocument
returns:
the properties.

haschanges

public boolean haschanges()
gets a value indicating whether the document has tracked changes.
specified by:
haschanges in interface idocument
returns:
if the document has tracked changes, set to true

gettrackchanges

public boolean gettrackchanges()
gets a value indicating whether tracking changes is turn on.
returns:
if track changes in on, set to true

settrackchanges

public void settrackchanges(boolean value)
sets a value indicating whether tracking changes is turn on.
parameters:
value - if track changes in on, set to true

getreplacefirst

public boolean getreplacefirst()
gets a value indicating whether need first replacing.
returns:
true indciates need first replacing.

setreplacefirst

public void setreplacefirst(boolean value)
sets a value indicating whether need first replacing.
parameters:
value - true indciates need first replacing.

gethtmlexportoptions

public htmlexportoptions gethtmlexportoptions()
gets the save options.
returns:
the save options.

isupdatefields

public boolean isupdatefields()
gets a value indicating whether to update fields in the document.
specified by:
isupdatefields in interface idocument
returns:
boolean

isupdatefields

public void isupdatefields(boolean value)
sets a value indicating whether to update fields in the document.
specified by:
isupdatefields in interface idocument
parameters:
value - if update fields, set to true

getdetectedformattype

public fileformat getdetectedformattype()
returns the detected format type of the document which was loaded. .
returns:
fileformat

setjpegquality

public void setjpegquality(int value)
sets the quality (q%) of the image of jpeg format, this property is only used for doc to pdf. the default value is 80.
parameters:
value - int

getpagecount

public int getpagecount()
gets total number of pages for document.
returns:
int

getprintdocument

public com.spire.ms.printing.printdocument getprintdocument()

iscontainmacro

public boolean iscontainmacro()
indicates whether the document has macros.
returns:
booelan

getkeepsameformat

public boolean getkeepsameformat()
gets a value that indicates whether to keep same formatting when it is merged to other document.
returns:
boolean

setkeepsameformat

public void setkeepsameformat(boolean value)
sets a value that indicates whether to keep same formatting when it is merged to other document.
parameters:
value - boolean

createparagraph

public paragraph createparagraph()
creates the paragraph.
specified by:
createparagraph in interface idocument
returns:
paragraph

createminialdocument

public void createminialdocument()
create a minial document, one empty section to the document and one empty paragraph to created section.
specified by:
createminialdocument in interface idocument

addsection

public section addsection()
adds new section to document.
specified by:
addsection in interface idocument
returns:
section

addparagraphstyle

public paragraphstyle addparagraphstyle(java.lang.string stylename)
adds new paragraph style to the document.
specified by:
addparagraphstyle in interface idocument
parameters:
stylename - paragraph style name
returns:
paragraphstyle

addliststyle

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

gettext

public java.lang.string gettext()
gets the document's text.
specified by:
gettext in interface idocument
returns:
string

sign

public static byte[] sign(java.io.inputstream sourcestream,
                          java.lang.string certificatepath,
                          java.lang.string securepassword)
create digitally signed word document. digital signature of documents support only doc and docx formats.
parameters:
sourcestream - source file stream
certificatepath - path to the file certificate
securepassword - password of the certificate.
returns:
bytes of signed word document

sign

public static byte[] sign(java.io.inputstream sourcestream,
                          byte[] certificatedata,
                          java.lang.string securepassword)
create digitally signed word document. digital signature of documents support only doc and docx formats.
parameters:
sourcestream - source file stream.
certificatedata - the certificate data.
securepassword - password of the certificate.
returns:
bytes of signed word document

deepclone

public document deepclone()
clones itself.
specified by:
deepclone in interface idocument
specified by:
deepclone in interface idocumentobject
overrides:
deepclone in class documentobject
returns:
document

clonedefaultstyleto

public void clonedefaultstyleto(document destdoc)
clones the current document default style to the destination document.
parameters:
destdoc - the destination document.

clonethemesto

public void clonethemesto(document destdoc)
clones the current document theme style to the destination document.
parameters:
destdoc - the destination document.

clonecompatibilityto

public void clonecompatibilityto(document destdoc)
clones the current document compatibility to the destination document.
parameters:
destdoc - the destination document.

importsection

public void importsection(isection section)
imports section into document.
parameters:
section - the section.

importcontent

public void importcontent(idocument doc)
imports all content into the document.
specified by:
importcontent in interface idocument
parameters:
doc - the doc.

importcontent

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

addstyle

public style addstyle(builtinstyle builtinstyle)
adds the style to the document style.
specified by:
addstyle in interface idocument
parameters:
builtinstyle - the built-in style.
returns:
style

acceptchanges

public void acceptchanges()
accepts changes tracked from the moment of last change acceptance.

rejectchanges

public void rejectchanges()
rejects changes tracked from the moment of last change acceptance.

protect

public void protect(protectiontype type)
protects the document.
specified by:
protect in interface idocument
parameters:
type - the type of the protection.

protect

public void protect(protectiontype type,
                    java.lang.string password)
protects the document.
specified by:
protect in interface idocument
parameters:
type - the type of the protection
password - the password used for protection.

encrypt

public void encrypt(java.lang.string password)
encrypts the document.
specified by:
encrypt in interface idocument
parameters:
password - the password

removeencryption

public void removeencryption()
removes the encryption.
specified by:
removeencryption in interface idocument

savetotxt

public void savetotxt(java.lang.string filename,
                      java.nio.charset.charset charset)
saves to text document with specified encoding.
parameters:
filename - name of the file.
charset - the charset.

loadtext

public void loadtext(java.lang.string filename)
opens the text document from a file with default encoding utf-8.
parameters:
filename - name of the file.

loadtext

public void loadtext(java.io.inputstream stream)
opens the text document from a stream with default encoding utf-8.
parameters:
stream - the stream.

loadtext

public void loadtext(java.lang.string filename,
                     java.nio.charset.charset charset)
opens the text document with specified encoding from a file.
parameters:
filename - name of the file.
charset - the charset.

loadtext

public void loadtext(java.io.inputstream stream,
                     java.nio.charset.charset charset)
opens the text document with specified encoding from a stream.
parameters:
stream - the text document stream.
charset - the charset

loadfromfile

public void loadfromfile(java.lang.string filename)
opens doc file.
specified by:
loadfromfile in interface idocument
parameters:
filename - file name

loadfromfile

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

loadfromfile

public void loadfromfile(java.lang.string filename,
                         fileformat fileformat,
                         xhtmlvalidationtype validationtype)
opens the html document from stream .
parameters:
filename - name of the file.
fileformat - type of the format.

loadfromfile

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

loadfromfileinreadmode

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

loadrtf

public void loadrtf(java.lang.string filename)
opens the rtf document from a file.
parameters:
filename - ame of the file.

loadrtf

public void loadrtf(java.io.inputstream stream)
opens the rtf document from a stream.
parameters:
stream - the stream.

loadrtf

public void loadrtf(java.lang.string filename,
                    java.nio.charset.charset charset)
opens the rtf document with specified encoding from a file.
parameters:
filename - name of the file.
charset - the charset

loadrtf

public void loadrtf(java.io.inputstream stream,
                    java.nio.charset.charset charset)
opens the rtf document with specified encoding from a stream.
parameters:
stream - the rtf document stream.
charset - the charset

savetofile

public void savetofile(java.lang.string filename)
saves to file in microsoft word format.
specified by:
savetofile in interface idocument
parameters:
filename - file name

savetofile

public void savetofile(java.lang.string filename,
                       topdfparameterlist paramlist)
saves the document to pdf file.
parameters:
filename - file name
paramlist - parameter list

savetofile

public void savetofile(java.lang.string filename,
                       java.util.list embeddedfontnamelist)
embedding fonts to pdf document.
parameters:
filename - file name
embeddedfontnamelist - embedded font name list

savetoepub

public void savetoepub(java.lang.string filename,
                       docpicture coverimage)
saves the epub document.
parameters:
filename - the file name.
coverimage - the cover image.

savetoepub

public void savetoepub(java.io.outputstream stream,
                       docpicture coverimage)
saves the epub document.
parameters:
stream - the stream.
coverimage - the cover image.

inserttextfromfile

public void inserttextfromfile(java.lang.string filename,
                               fileformat fileformat)
insert text from a file.
parameters:
filename - file name
fileformat - type of the format

inserttextfromstream

public void inserttextfromstream(java.io.inputstream stream,
                                 fileformat fileformat)
insert text from stream.
parameters:
stream - the stream.
fileformat - type of the format

savetofile

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

savetosvg

public void savetosvg(java.lang.string filename)
saves the svg.
parameters:
filename - the file name.

savetosvg

public java.util.list savetosvg()
saves the svg.
returns:
queue

savetostream

public void savetostream(java.io.outputstream stream,
                         topdfparameterlist paramlist)
embedding fonts to pdf document.
parameters:
stream - stream
paramlist - embedded font name list

loadfromstream

public void loadfromstream(java.io.inputstream stream,
                           fileformat fileformat,
                           xhtmlvalidationtype validationtype)
opens the html document from stream .
parameters:
stream - the stream.
fileformat - type of the format.
validationtype - type of the validation.

loadfromstream

public void loadfromstream(java.io.inputstream stream,
                           fileformat fileformat)
opens the document from stream in xml or microsoft word format.
specified by:
loadfromstream in interface idocument
parameters:
stream - stream
fileformat - fileformat

loadfromstream

public void loadfromstream(java.io.inputstream stream,
                           fileformat fileformat,
                           java.lang.string password)
opens the document from stream in xml or microsoft word format.
parameters:
stream - the stream.
fileformat - type of the format.
password - the password.

savetostream

public void savetostream(java.io.outputstream stream,
                         fileformat fileformat,
                         java.lang.string certificatepath,
                         java.lang.string securepassword)
saves document to stream and digitally sign, only doc and docx are supported.
parameters:
stream - the stream.
fileformat - the file format.
certificatepath - path to the file certificate
securepassword - password of the certificate.

savetostream

public void savetostream(java.io.outputstream stream,
                         fileformat fileformat,
                         byte[] certificatedata,
                         java.lang.string securepassword)
saves document to stream and digitally sign, only doc and docx are supported.
parameters:
stream - the stream.
fileformat - the file format.
certificatedata - the certificate data.
securepassword - password of the certificate.

savetostream

public void savetostream(com.spire.ms.system.io.stream stream,
                         fileformat fileformat,
                         byte[] certificatedata,
                         java.lang.string securepassword)
saves document to stream and digitally sign, only doc and docx are supported.
parameters:
stream - the stream.
fileformat - the file format.
certificatedata - the certificate data.
securepassword - password of the certificate.

savetofile

public void savetofile(java.lang.string filename,
                       fileformat fileformat,
                       java.lang.string certificatepath,
                       java.lang.string securepassword)
saves document to file and digitally sign, only doc and docx are supported.
parameters:
filename - the file.
fileformat - the file format.
certificatepath - path to the file certificate
securepassword - password of the certificate.

savetofile

public void savetofile(java.lang.string filename,
                       fileformat fileformat,
                       byte[] certificatedata,
                       java.lang.string securepassword)
saves document to file and digitally sign, only doc and docx are supported.
parameters:
filename - the file.
fileformat - the file format.
certificatedata - the certificate data.
securepassword - password of the certificate.

savetostream

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

savetofile

public void savetofile(java.io.outputstream stream,
                       fileformat fileformat)
saves the document into stream in xml or microsoft word format.
specified by:
savetofile in interface idocument
parameters:
stream - the output stream
fileformat - the file format

close

public void close()
closes this instance.

dispose

public void dispose()
prerforms application-defined tasks associated with freeing,releasing, or resetting unmanaged resources.

savetoimages

public java.awt.image.bufferedimage[] savetoimages(imagetype type)
save the whole document into images
specified by:
savetoimages in interface idocument
parameters:
type - the imagetype
returns:
the bufferedimages

savetoimages

public java.awt.image.bufferedimage savetoimages(int pageindex,
                                                 imagetype type)
save the specified page into image
specified by:
savetoimages in interface idocument
parameters:
pageindex - zero based page index
type - the imagetype
returns:
the bufferedimage

savetoimages

public java.awt.image.bufferedimage[] savetoimages(int pageindex,
                                                   int pagecount,
                                                   imagetype type)
save the specified range of pages into images
specified by:
savetoimages in interface idocument
parameters:
pageindex - starting page index (zero based)
pagecount - number of pages
type - the imagetype
returns:
the bufferedimages

findpattern

public textselection findpattern(java.util.regex.pattern pattern)
finds and returns entry of specified regular expression along with formatting.
specified by:
findpattern in interface idocument
parameters:
pattern - regex pattern
returns:
found text selection

findpatterninline

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

findstring

public textselection findstring(java.lang.string stringvalue,
                                boolean casesensitive,
                                boolean wholeword)
finds and returns string along with formatting.
specified by:
findstring in interface idocument
parameters:
stringvalue - stringvalue
casesensitive - casesensitive
wholeword - wholeword
returns:
textselection

findstringinline

public textselection[] findstringinline(java.lang.string given,
                                        boolean casesensitive,
                                        boolean wholeword)
finds the first entry of matchstring text in single-line mode.
specified by:
findstringinline in interface idocument
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:
list of textselection

findallpattern

public textselection[] findallpattern(java.util.regex.pattern pattern)
returns all entries of matchstring regex.
specified by:
findallpattern in interface idocument
parameters:
pattern - the pattern
returns:
list of textselection

findallstring

public textselection[] findallstring(java.lang.string matchstring,
                                     boolean casesensitive,
                                     boolean wholeword)
returns all entries of matchstring string, taking into consideration casesensitive and wholeword options.
specified by:
findallstring in interface idocument
parameters:
matchstring - matchstring
casesensitive - casesensitive
wholeword - wholeword
returns:
list of textselection

replace

public int replace(java.util.regex.pattern pattern,
                   java.lang.string replace)
replaces all entries of matchstring regular expression with newvalue string.
specified by:
replace in interface idocument
parameters:
pattern - pattern
replace - replace
returns:
int

replace

public int replace(java.lang.string matchstring,
                   java.lang.string newvalue,
                   boolean casesensitive,
                   boolean wholeword)
replaces all entries of matchstring string with newvalue string, taking into consideration casesensitive and wholeword options.
specified by:
replace in interface idocument
parameters:
matchstring - the match string
newvalue - the new value
casesensitive - is case sensitive or not
wholeword - is whole word or not
returns:
the count of replacement

replace

public int replace(java.lang.string matchstring,
                   textselection textselection,
                   boolean casesensitive,
                   boolean wholeword)
replaces all entries of matchstring string with textselection, taking into consideration casesensitive and wholeword options.
specified by:
replace in interface idocument
parameters:
matchstring - 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:
the count of replacement

replace

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

replace

public int replace(java.lang.string matchstring,
                   idocument matchdoc,
                   boolean casesensitive,
                   boolean wholeword)
replaces the specified matchstring.
parameters:
matchstring - the matchstring.
matchdoc - the newvalue doc.
casesensitive - if it is case sensitive, set to true
wholeword - if specifies whole word,set to true
returns:
int

updatewordcount

public void updatewordcount()
update paragraphs count, word count and character count
specified by:
updatewordcount in interface idocument

updatewordcount

public void updatewordcount(char[] splitchar)
update paragraphs count, word count and character count.
parameters:
splitchar - the word separator.

updatewordcount

public void updatewordcount(char[] splitchar,
                            boolean includetbfnen)
update paragraphs count, word count and character count.
parameters:
splitchar - the word separator.
includetbfnen - the include text boxes,footnotes and endnotes.

getpagecountex

public int getpagecountex()
gets total number of pages for document.
returns:
int

updatetableofcontents

public void updatetableofcontents()
update table of contents in the document.

updatetableofcontents

public void updatetableofcontents(tableofcontent toc)

replaceinline

public int replaceinline(java.lang.string matchstring,
                         java.lang.string newvalue,
                         boolean casesensitive,
                         boolean wholeword)
replaces all entries of matchstring text with newvalue text in single-line mode.
specified by:
replaceinline in interface idocument
parameters:
matchstring - the matchstring.
newvalue - the newvalue.
casesensitive - if it specifies case sensitive, set to true
wholeword - if it specifies whole word to be newvalue, set to true
returns:
int

replaceinline

public int replaceinline(java.util.regex.pattern pattern,
                         java.lang.string newvalue)
replaces all entries with specified pattern with newvalue text in single-line mode.
specified by:
replaceinline in interface idocument
parameters:
pattern - the pattern.
newvalue - the newvalue.
returns:
int

replaceinline

public int replaceinline(java.lang.string matchstring,
                         textselection matchselection,
                         boolean casesensitive,
                         boolean wholeword)
replaces the matchstring text with matchselection in single-line mode.
specified by:
replaceinline in interface idocument
parameters:
matchstring - the matchstring.
matchselection - 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 count of replacement

replaceinline

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

findstring

public textselection findstring(bodyregion start,
                                java.lang.string matchstring,
                                boolean casesensitive,
                                boolean wholeword)
finds the next entry of matchstring string, taking into consideration casesensitive and wholeword options.
specified by:
findstring in interface idocument
parameters:
start - search starts.
matchstring - 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

public textselection findpattern(bodyregion start,
                                 java.util.regex.pattern pattern)
finds the next entry of matchstring pattern.
specified by:
findpattern in interface idocument
parameters:
start - search starts
pattern - the pattern.
returns:
textselection

findstringinline

public textselection[] findstringinline(bodyregion start,
                                        java.lang.string matchstring,
                                        boolean casesensitive,
                                        boolean wholeword)
finds the next matchstring text starting from specified using single-line mode.
specified by:
findstringinline in interface idocument
parameters:
start - search start.
matchstring - 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:
the array of the text selection

findpatterninline

public textselection[] findpatterninline(bodyregion start,
                                         java.util.regex.pattern pattern)
finds the text which fit the specified pattern starting from start. using single-line mode.
specified by:
findpatterninline in interface idocument
parameters:
start - search start.
pattern - the pattern.
returns:
list of textselection

resetfindstate

public void resetfindstate()
resets the findpattern.
specified by:
resetfindstate in interface idocument

createparagraphitem

public paragraphbase createparagraphitem(paragraphitemtype itemtype)
creates new paragraph item instance.
parameters:
itemtype - paragraph item type
returns:
paragraphbase

clearmacros

public void clearmacros()
removes the macros from the document.


网站地图