|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.spire.doc.OwnerHolder
com.spire.doc.documents.xml.DocumentSerializable
com.spire.doc.DocumentObject
com.spire.doc.DocumentBase
com.spire.doc.DocumentContainer
com.spire.doc.Document
public class Document
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()
|
|
Document(boolean useNewEngine)
|
protected |
Document(Document doc)
|
|
Document(java.io.InputStream stream)
Initializes a new instance of the Document class from the stream. |
|
Document(java.io.InputStream stream,
boolean useNewEngine)
|
|
Document(java.io.InputStream inputStream,
FileFormat type)
Initializes a new instance of the Document class from the stream of specified type protected with password. |
|
Document(java.io.InputStream inputStream,
FileFormat type,
boolean useNewEngine)
Initializes a new instance of the Document class from the stream of specified type protected with password. |
|
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 inputStream,
FileFormat type,
java.lang.String password,
boolean useNewEngine)
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 stream,
FileFormat type,
XHTMLValidationType validationType,
boolean useNewEngine)
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.io.InputStream inputStream,
java.lang.String password,
boolean useNewEngine)
Initializes a new instance of the Document class from the Word document�s stream, which is protected with password. |
|
Document(java.lang.String fileName)
|
|
Document(java.lang.String fileName,
boolean useNewEngine)
|
|
Document(java.lang.String fileName,
FileFormat type)
|
|
Document(java.lang.String fileName,
FileFormat type,
boolean useNewEngine)
|
|
Document(java.lang.String fileName,
FileFormat type,
java.lang.String password)
|
|
Document(java.lang.String fileName,
FileFormat type,
java.lang.String password,
boolean useNewEngine)
|
|
Document(java.lang.String fileName,
FileFormat type,
XHTMLValidationType validationType)
|
|
Document(java.lang.String fileName,
FileFormat type,
XHTMLValidationType validationType,
boolean useNewEngine)
|
|
Document(java.lang.String fileName,
java.lang.String password)
|
|
Document(java.lang.String fileName,
java.lang.String password,
boolean useNewEngine)
|
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. |
boolean |
checkProtectionPassWord(java.lang.String password)
Check that the password entered is the same as the permission protection password |
void |
cleanup()
|
void |
cleanup(CleanupOptions options)
|
void |
clearCustomFontsFolders()
Clear the path of the folder where the custom font is located. |
static void |
clearGlobalCustomFontsFolders()
Clear the path of the folder where the global custom font is located. |
void |
clearMacros()
Removes the macros from the document. |
static void |
clearSystemFontCache()
Clears the memory used by cached system fonts. |
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 |
cloneSettingsTo(Document destDoc)
Clones the current document settings to the destination document. |
void |
cloneThemesTo(Document destDoc)
Clones the current document theme style to the destination document. |
void |
cloneWebSettingsTo(Document destDoc)
clone Websettings to other document |
void |
close()
Closes this instance. |
void |
compare(Document document,
java.lang.String author)
Compares this document with another document. |
void |
compare(Document document,
java.lang.String author,
CompareOptions options)
Compares this document with another document. |
void |
compare(Document document,
java.lang.String author,
java.util.Date date)
Compares this document with another document. |
void |
compare(Document document,
java.lang.String author,
java.util.Date date,
CompareOptions options)
Compares this document with another document. |
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[] |
findAllPattern(java.util.regex.Pattern pattern,
boolean isAdvancedSearch)
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. |
boolean |
getAutoUpdateStylesByTemplate()
Gets a value indicating whether updating the styles in this document to match the styles in the attached template each time you open . |
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()
|
boolean |
getEmbedSystemFonts()
|
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. |
boolean |
getForceTableRelayout()
Gets or set a value indicating whether force table to relayout.. |
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()
Gets the custom punctuation as sentence indentifier. |
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. |
int |
getJPEGQuality()
Gets the quality (Q%) of the image of JPEG format, this property is only used for doc to pdf. |
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. |
FileFormat |
getOriginalFileFormat()
|
int |
getPageCount()
Gets total number of pages for document. |
int |
getPageCountEx()
Gets total number of pages for document. |
PrintDocument |
getPrintDocument()
|
com.spire.ms.System.Collections.Generic.List |
getPrivateFontList()
|
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 document. |
boolean |
getTrackChanges()
Gets a value indicating whether tracking changes is turn on. |
int |
getUrlConnectTimeOut()
|
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. |
static boolean |
isEncrypted(java.io.InputStream stream)
Check that the document is encrypted |
static boolean |
isEncrypted(java.lang.String fileName)
Check that the document is encrypted |
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 |
loadFontFallbackRuleSettings(java.lang.String fileName)
Load the font fallback rules from the xml |
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)
|
void |
loadRtf(java.io.InputStream stream,
com.spire.ms.System.Text.Encoding encoding)
|
void |
loadRtf(java.lang.String fileName)
Opens the rtf document from a file. |
void |
loadRtf(java.lang.String fileName,
com.spire.ms.System.Text.Encoding encoding)
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 |
printMultipageToOneSheet(PagesPreSheet pagesPerSheet)
Print multipage to one sheet |
void |
printMultipageToOneSheet(PagesPreSheet pagesPerSheet,
boolean printPageBorders)
Print multipage to one sheet |
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 |
resetPageLayoutCache()
Reset the page layout cache data of the new engine. |
void |
saveFontFallbackRuleSettings(java.lang.String fileName)
Save the default font fallback rules to the xml |
void |
saveToEpub(com.spire.ms.System.IO.Stream stream,
DocPicture coverImage)
aves 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,
com.spire.ms.System.Net.HttpWebResponse response,
HttpContentType contentType)
Saves the specified file name. |
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,
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)
Converts the specified page into image. |
java.awt.image.BufferedImage[] |
saveToImages(int pageIndex,
int pageCount,
ImageType type,
int dpiX,
int dpiY)
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)
Saves document to stream and digitally sign, Only DOC and DOCX are supported. |
java.util.List<byte[]> |
saveToSVG()
Saves the SVG. |
java.util.List<byte[]> |
saveToSVG(boolean outputToOneSvg)
Saves the SVG. |
void |
saveToSVG(java.lang.String fileName)
Saves the SVG. |
void |
saveToSVG(java.lang.String fileName,
boolean outputToOneSvg)
Saves the SVG. |
void |
saveToTiff(java.lang.String tiffFilename)
save doc to tiff. |
void |
saveToTxt(java.lang.String fileName,
java.nio.charset.Charset charset)
Saves to text document with specified encoding. |
void |
setAutoUpdateStylesByTemplate(boolean value)
Sets a value indicating whether updating the styles in this document to match the styles in the attached template each time you open . |
void |
setCustomFontsFolders(java.lang.String fontPath)
Set the path to the folder where the custom font is located. |
void |
setDateTimeOfUnitTest(java.util.Date dateTime)
Sets date and time of the unit test. |
void |
setEmbedFontsInFile(boolean value)
|
void |
setEmbedSystemFonts(boolean value)
|
void |
setForceTableRelayout(boolean value)
|
static void |
setGlobalCustomFontsFolders(java.io.InputStream[] fontStreamList)
Sets the path to the folder where the global custom font is located. |
static void |
setGlobalCustomFontsFolders(java.lang.String fontPath)
Sets the path to the folder where the global custom font is located. |
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)
Sets 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 document. |
void |
setTrackChanges(boolean value)
Sets a value indicating whether tracking changes is turn on. |
void |
setUrlConnectTimeOut(int value)
set timeout. |
void |
setWatermark(PictureWatermark value,
int sectionIndex)
Sets document's Picturewatermark. |
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 |
updatePageLayout()
Updates the page layout of the document. |
void |
updateTableLayout()
Update table grid before saving the document when using the new engine. |
void |
updateTableOfContents()
Update Table of contents in the document. |
void |
updateTableOfContents(TableOfContent toc)
Update specified Table of content in the document. |
void |
updateTOCPageNumbers()
Update Table of contents page numbers in the document. |
void |
updateTOCPageNumbers(TableOfContent toc)
Update specified Table of content page numbers in the document. |
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.DocumentContainer |
---|
getCount, getIndex |
Methods inherited from class com.spire.doc.DocumentObject |
---|
getFirstChild, getLastChild, getNextSibling, getNextWidgetSibling, getOwner, getPreviousSibling, getPreviousWidgetSibling, isComposite, prependChild, toString |
Methods inherited from class com.spire.doc.OwnerHolder |
---|
getDocument |
Methods inherited from interface com.spire.doc.interfaces.IDocument |
---|
saveToImages |
Methods inherited from interface com.spire.doc.interfaces.IDocumentObject |
---|
getDocument, getNextSibling, getOwner, getPreviousSibling, isComposite |
Field Detail |
---|
public BookmarkLevelHandler BookmarkLayout
public PageLayoutHandler PageLayout
public UpdateFieldsHandler UpdateFields
Constructor Detail |
---|
public Document(java.lang.String fileName)
public Document(java.lang.String fileName, boolean useNewEngine)
public Document(java.lang.String fileName, java.lang.String password)
public Document(java.lang.String fileName, java.lang.String password, boolean useNewEngine)
public Document(java.lang.String fileName, FileFormat type)
public Document(java.lang.String fileName, FileFormat type, boolean useNewEngine)
public Document(java.lang.String fileName, FileFormat type, XHTMLValidationType validationType)
public Document(java.lang.String fileName, FileFormat type, XHTMLValidationType validationType, boolean useNewEngine)
public Document(java.lang.String fileName, FileFormat type, java.lang.String password)
public Document(java.lang.String fileName, FileFormat type, java.lang.String password, boolean useNewEngine)
public Document(java.io.InputStream stream, FileFormat type, XHTMLValidationType validationType)
stream
- The file stream.type
- The type of the opened document.validationType
- Type of the validation.public Document(java.io.InputStream stream, FileFormat type, XHTMLValidationType validationType, boolean useNewEngine)
stream
- The file stream.type
- The type of the opened document.validationType
- Type of the validation.useNewEngine
- Use new engine.public Document()
public Document(boolean useNewEngine)
useNewEngine
- public Document(java.io.InputStream stream)
stream
- The stream.public Document(java.io.InputStream stream, boolean useNewEngine)
public Document(java.io.InputStream inputStream, FileFormat type)
inputStream
- The stream.type
- The type.public Document(java.io.InputStream inputStream, FileFormat type, boolean useNewEngine)
inputStream
- The stream.type
- The type.useNewEngine
- use new engine.public Document(java.io.InputStream inputStream, java.lang.String password)
inputStream
- The stream.password
- The password.public Document(java.io.InputStream inputStream, java.lang.String password, boolean useNewEngine)
inputStream
- The stream.password
- The password.useNewEngine
- use new engine.public Document(java.io.InputStream inputStream, FileFormat type, java.lang.String password)
inputStream
- The stream.type
- The type.password
- The password.public Document(java.io.InputStream inputStream, FileFormat type, java.lang.String password, boolean useNewEngine)
inputStream
- The stream.type
- The type.password
- The password.useNewEngine
- use new engine.protected Document(Document doc)
Method Detail |
---|
public TableOfContent getTOC()
IDocument
getTOC
in interface IDocument
public void setTOC(TableOfContent value)
IDocument
setTOC
in interface IDocument
value
- TableOfContentpublic boolean getEmbedFontsInFile()
public void setEmbedFontsInFile(boolean value)
public com.spire.ms.System.Collections.Generic.List getPrivateFontList()
public boolean getEmbedSystemFonts()
public void setEmbedSystemFonts(boolean value)
public void loadFontFallbackRuleSettings(java.lang.String fileName)
fileName
- the xml file namepublic void saveFontFallbackRuleSettings(java.lang.String fileName)
fileName
- the xml file namepublic java.lang.String getHtmlBaseUrl()
public void setHtmlBaseUrl(java.lang.String value)
value
- Stringpublic boolean getHTMLTrackChanges()
public void setHTMLTrackChanges(boolean value)
value
- booleanpublic boolean getHTMLSentenceIdentifier()
public void setHTMLSentenceIdentifier(boolean value)
value
- boolean valuepublic boolean getHTMLCustomComment()
public void setHTMLCustomComment(boolean value)
value
- boolean valuepublic java.util.List getHTMLIdentifierPunctuations()
public void setHTMLIdentifierPunctuations(java.util.List value)
value
- Listpublic java.util.List<Footnote> getFootnotes()
public java.util.List<Footnote> getEndnotes()
public DocumentObjectType getDocumentObjectType()
getDocumentObjectType
in interface IDocumentObject
getDocumentObjectType
in class DocumentObject
public BuiltinDocumentProperties getBuiltinDocumentProperties()
getBuiltinDocumentProperties
in interface IDocument
public CustomDocumentProperties getCustomDocumentProperties()
getCustomDocumentProperties
in interface IDocument
public SectionCollection getSections()
getSections
in interface IDocument
public StyleCollection getStyles()
getStyles
in interface IDocument
public ListStyleCollection getListStyles()
getListStyles
in interface IDocument
public BookmarkCollection getBookmarks()
getBookmarks
in interface IDocument
public FieldCollection getFields()
public CommentsCollection getComments()
getComments
in interface IDocument
public TextBoxCollection getTextBoxes()
getTextBoxes
in interface IDocument
public void setTextBoxes(TextBoxCollection value)
value
- TextBoxCollectionpublic Section getLastSection()
getLastSection
in interface IDocument
public Paragraph getLastParagraph()
getLastParagraph
in interface IDocument
public FootEndnoteOptions getEndnoteOptions()
public FootEndnoteOptions getFootnoteOptions()
public WatermarkBase getWatermark()
getWatermark
in interface IDocument
public void setWatermark(WatermarkBase value)
setWatermark
in interface IDocument
value
- WatermarkBasepublic void setWatermark(PictureWatermark value, int sectionIndex)
value
- sectionIndex
- public Background getBackground()
getBackground
in interface IDocument
public MailMerge getMailMerge()
getMailMerge
in interface IDocument
public ProtectionType getProtectionType()
getProtectionType
in interface IDocument
public void setProtectionType(ProtectionType value)
setProtectionType
in interface IDocument
value
- ProtectionTypepublic ViewSetup getViewSetup()
getViewSetup
in interface IDocument
public boolean getQuiteMode()
public void setQuiteMode(boolean value)
value
- booleanpublic DocumentObjectCollection getChildObjects()
getChildObjects
in interface ICompositeObject
getChildObjects
in class DocumentObject
public XHTMLValidationType getXHTMLValidateOption()
public void setXHTMLValidateOption(XHTMLValidationType value)
value
- The HTML validate option.public VariableCollection getVariables()
getVariables
in interface IDocument
public DocumentProperties getProperties()
getProperties
in interface IDocument
public boolean hasChanges()
hasChanges
in interface IDocument
public boolean getTrackChanges()
public void setTrackChanges(boolean value)
value
- if track changes in on, set to truepublic boolean getAutoUpdateStylesByTemplate()
public void setAutoUpdateStylesByTemplate(boolean value)
public boolean getReplaceFirst()
public void setReplaceFirst(boolean value)
value
- True indciates need first replacing.public HtmlExportOptions getHtmlExportOptions()
public boolean isUpdateFields()
isUpdateFields
in interface IDocument
public void isUpdateFields(boolean value)
isUpdateFields
in interface IDocument
value
- if update fields, set to truepublic FileFormat getDetectedFormatType()
public int getJPEGQuality()
public void setJPEGQuality(int value)
value
- intpublic int getUrlConnectTimeOut()
public void setUrlConnectTimeOut(int value)
value
- public int getPageCount()
public PrintDocument getPrintDocument()
public boolean isContainMacro()
public boolean getKeepSameFormat()
public void setKeepSameFormat(boolean value)
value
- booleanpublic Paragraph createParagraph()
createParagraph
in interface IDocument
public void createMinialDocument()
createMinialDocument
in interface IDocument
public Section addSection()
addSection
in interface IDocument
public ParagraphStyle addParagraphStyle(java.lang.String styleName)
addParagraphStyle
in interface IDocument
styleName
- Paragraph style name
public ListStyle addListStyle(ListType listType, java.lang.String styleName)
addListStyle
in interface IDocument
listType
- List typestyleName
- Paragraph style name
public java.lang.String getText()
getText
in interface IDocument
public static byte[] sign(java.io.InputStream sourceStream, java.lang.String certificatePath, java.lang.String securePassword)
sourceStream
- Source file streamcertificatePath
- Path to the file certificatesecurePassword
- Password of the certificate.
public static byte[] sign(java.io.InputStream sourceStream, byte[] certificateData, java.lang.String securePassword)
sourceStream
- Source file stream.certificateData
- the certificate data.securePassword
- Password of the certificate.
public Document deepClone()
deepClone
in interface IDocument
deepClone
in interface IDocumentObject
deepClone
in class DocumentObject
public void cloneDefaultStyleTo(Document destDoc)
destDoc
- public void cloneThemesTo(Document destDoc)
destDoc
- The destination document.public void cloneCompatibilityTo(Document destDoc)
destDoc
- The destination document.public void cloneSettingsTo(Document destDoc)
destDoc
- The destination document.public void importSection(ISection section)
section
- The section.public void importContent(IDocument doc)
importContent
in interface IDocument
doc
- IDocumentpublic void importContent(IDocument doc, boolean importStyles)
importContent
in interface IDocument
doc
- IDocumentimportStyles
- public Style addStyle(BuiltinStyle builtinStyle)
addStyle
in interface IDocument
builtinStyle
- BuiltinStyle
public void acceptChanges()
public void rejectChanges()
public boolean checkProtectionPassWord(java.lang.String password)
password
- The enter password
public void protect(ProtectionType type)
protect
in interface IDocument
type
- ProtectionTypepublic void protect(ProtectionType type, java.lang.String password)
protect
in interface IDocument
type
- The type of the protectionpassword
- The password used for protection.public static boolean isEncrypted(java.lang.String fileName)
fileName
- File name
public static boolean isEncrypted(java.io.InputStream stream)
stream
- stream
public void encrypt(java.lang.String password)
encrypt
in interface IDocument
password
- Password.public void removeEncryption()
removeEncryption
in interface IDocument
public void printMultipageToOneSheet(PagesPreSheet pagesPerSheet)
pagesPerSheet
- The number of pages per one sheet.public void printMultipageToOneSheet(PagesPreSheet pagesPerSheet, boolean printPageBorders)
pagesPerSheet
- The number of pages per one sheet.printPageBorders
- The flag that indicates whether printed the page borders.public void saveToTxt(java.lang.String fileName, java.nio.charset.Charset charset)
fileName
- Name of the file.charset
- The charset.public void loadText(java.lang.String fileName)
fileName
- Name of the file.public void loadText(java.io.InputStream stream)
stream
- The stream.public void loadText(java.lang.String fileName, java.nio.charset.Charset charset)
fileName
- Name of the file.charset
- The encodingpublic void loadText(java.io.InputStream stream, java.nio.charset.Charset charset)
stream
- The text document stream.charset
- The encodingpublic void loadFromFile(java.lang.String fileName)
loadFromFile
in interface IDocument
fileName
- public void loadFromFile(java.lang.String fileName, FileFormat fileFormat)
loadFromFile
in interface IDocument
fileName
- fileFormat
- public void loadFromFile(java.lang.String fileName, FileFormat fileFormat, XHTMLValidationType validationType)
fileName
- Name of the file.fileFormat
- Type of the format.validationType
- Type of the validation.public void loadFromFile(java.lang.String fileName, FileFormat fileFormat, java.lang.String password)
fileName
- Name of the file.fileFormat
- Type of the format.password
- The password.public void loadFromFileInReadMode(java.lang.String strFileName, FileFormat fileFormat)
loadFromFileInReadMode
in interface IDocument
strFileName
- File to open.fileFormat
- Type of the format.public void loadRtf(java.lang.String fileName)
fileName
- Name of the file.public void loadRtf(java.io.InputStream stream)
public void loadRtf(java.lang.String fileName, com.spire.ms.System.Text.Encoding encoding)
fileName
- Name of the file.encoding
- The encodingpublic void loadRtf(java.io.InputStream stream, com.spire.ms.System.Text.Encoding encoding)
stream
- The rtf document stream.encoding
- The encodingpublic void saveToFile(java.lang.String fileName)
saveToFile
in interface IDocument
fileName
- public void saveToFile(java.lang.String fileName, ToPdfParameterList paramList)
fileName
- File nameparamList
- Parameter listpublic void saveToEpub(java.lang.String fileName, DocPicture coverImage)
fileName
- The file name.coverImage
- The cover image.public void saveToEpub(com.spire.ms.System.IO.Stream stream, DocPicture coverImage)
stream
- The stream.coverImage
- The cover image.public void insertTextFromFile(java.lang.String fileName, FileFormat fileFormat)
fileName
- File namefileFormat
- Type of the formatpublic void insertTextFromStream(java.io.InputStream stream, FileFormat fileFormat)
stream
- The stream.fileFormat
- Type of the formatpublic void saveToFile(java.lang.String fileName, FileFormat fileFormat)
saveToFile
in interface IDocument
fileName
- File namefileFormat
- Type of the formatpublic void saveToFile(java.lang.String fileName, FileFormat fileFormat, com.spire.ms.System.Net.HttpWebResponse response, HttpContentType contentType)
fileName
- Name of the file.fileFormat
- Type of the format.response
- The response.contentType
- The content disposition.public void saveToSVG(java.lang.String fileName)
fileName
- The file name.public void saveToSVG(java.lang.String fileName, boolean outputToOneSvg)
fileName
- The file name.outputToOneSvg
- Output to one Svg.public java.util.List<byte[]> saveToSVG()
public java.util.List<byte[]> saveToSVG(boolean outputToOneSvg)
public void saveToStream(java.io.OutputStream stream, ToPdfParameterList paramList)
stream
- The stream.paramList
- public void loadFromStream(java.io.InputStream stream, FileFormat fileFormat, XHTMLValidationType validationType)
stream
- The stream.fileFormat
- Type of the format.validationType
- Type of the validation.public void loadFromStream(java.io.InputStream stream, FileFormat fileFormat)
loadFromStream
in interface IDocument
stream
- streamfileFormat
- fileFormatpublic void loadFromStream(java.io.InputStream stream, FileFormat fileFormat, java.lang.String password)
stream
- The stream.fileFormat
- Type of the format.password
- The password.public void saveToStream(java.io.OutputStream stream, FileFormat fileFormat, java.lang.String certificatePath, java.lang.String securePassword)
stream
- The stream.fileFormat
- The file format.certificatePath
- Path to the file certificatesecurePassword
- Password of the certificate.public void saveToStream(java.io.OutputStream stream, FileFormat fileFormat, byte[] certificateData, java.lang.String securePassword)
stream
- The stream.fileFormat
- The file format.certificateData
- The certificate data.securePassword
- Password of the certificate.public void saveToFile(java.lang.String fileName, FileFormat fileFormat, java.lang.String certificatePath, java.lang.String securePassword)
fileName
- The file.fileFormat
- The file format.certificatePath
- Path to the file certificatesecurePassword
- Password of the certificate.public void saveToFile(java.lang.String fileName, FileFormat fileFormat, byte[] certificateData, java.lang.String securePassword)
fileName
- The file.fileFormat
- The file format.certificateData
- The certificate data.securePassword
- Password of the certificate.public void saveToStream(java.io.OutputStream stream, FileFormat fileFormat)
stream
- The output streamfileFormat
- The file formatpublic void saveToFile(java.io.OutputStream stream, FileFormat fileFormat)
saveToFile
in interface IDocument
stream
- fileFormat
- public void close()
close
in class DocumentBase
public void dispose()
public void saveToTiff(java.lang.String tiffFilename)
tiffFilename
- public java.awt.image.BufferedImage[] saveToImages(ImageType type)
saveToImages
in interface IDocument
type
- The ImageType
public java.awt.image.BufferedImage saveToImages(int pageIndex, ImageType type)
IDocument
saveToImages
in interface IDocument
pageIndex
- zero based page indextype
- the ImageType
public java.awt.image.BufferedImage[] saveToImages(int pageIndex, int pageCount, ImageType type, int dpiX, int dpiY)
pageIndex
- Starting page index (Zero based)pageCount
- Number of pagestype
- The ImageTypedpiX
- The resolution of XdpiY
- The resolution of Y
public TextSelection findPattern(java.util.regex.Pattern pattern)
findPattern
in interface IDocument
pattern
- regex pattern
public TextSelection[] findPatternInLine(java.util.regex.Pattern pattern)
findPatternInLine
in interface IDocument
pattern
- The pattern.
public TextSelection findString(java.lang.String stringValue, boolean caseSensitive, boolean wholeWord)
findString
in interface IDocument
stringValue
- caseSensitive
- wholeWord
-
public TextSelection[] findStringInLine(java.lang.String given, boolean caseSensitive, boolean wholeWord)
findStringInLine
in interface IDocument
given
- The string to find.caseSensitive
- if set to wholeWord
- if it search the whole word, set to public TextSelection[] findAllPattern(java.util.regex.Pattern pattern)
findAllPattern
in interface IDocument
pattern
- The pattern
public TextSelection[] findAllPattern(java.util.regex.Pattern pattern, boolean isAdvancedSearch)
pattern
- The patternisAdvancedSearch
- whether is advanced search. You can find "str" in more than one paragraph.
public TextSelection[] findAllString(java.lang.String matchString, boolean caseSensitive, boolean wholeWord)
findAllString
in interface IDocument
matchString
- caseSensitive
- wholeWord
-
public int replace(java.util.regex.Pattern pattern, java.lang.String replace)
replace
in interface IDocument
pattern
- patternreplace
- replace
public int replace(java.lang.String matchString, java.lang.String newValue, boolean caseSensitive, boolean wholeWord)
replace
in interface IDocument
matchString
- newValue
- caseSensitive
- wholeWord
-
public int replace(java.lang.String matchString, TextSelection textSelection, boolean caseSensitive, boolean wholeWord)
replace
in interface IDocument
matchString
- The matchString.textSelection
- The text selection.caseSensitive
- if it is case sensitive, set to wholeWord
- if it specifies whole word, set to public int replace(java.util.regex.Pattern pattern, TextSelection textSelection)
replace
in interface IDocument
pattern
- The pattern.textSelection
- The text selection.
public void cloneWebSettingsTo(Document destDoc)
destDoc
- The other docpublic int replace(java.lang.String matchString, IDocument matchDoc, boolean caseSensitive, boolean wholeWord)
matchString
- The matchString.matchDoc
- The newValue doc.caseSensitive
- if it is case sensitive, set to wholeWord
- if specifies whole word,set to public void updateWordCount()
updateWordCount
in interface IDocument
public void updateWordCount(char[] splitchar)
splitchar
- The word separator.public void updateWordCount(char[] splitchar, boolean includeTbFnEn)
splitchar
- The word separator.includeTbFnEn
- The include text boxes,footnotes and endnotes.public int getPageCountEx()
public void updateTableOfContents()
public void updateTableOfContents(TableOfContent toc)
toc
- public void updateTOCPageNumbers()
public void updateTOCPageNumbers(TableOfContent toc)
toc
- specified Table of contentpublic void compare(Document document, java.lang.String author)
document
- Document to compareauthor
- The author to use for revisionspublic void compare(Document document, java.lang.String author, CompareOptions options)
document
- Document to compareauthor
- The author to use for revisionsoptions
- The comparison parameterpublic void compare(Document document, java.lang.String author, java.util.Date date)
document
- The document to compareauthor
- The author to use for revisionsdate
- The date and time to use for revisionspublic void compare(Document document, java.lang.String author, java.util.Date date, CompareOptions options)
document
- The document to compareauthor
- The author to use for revisionsdate
- The date and time to use for revisionsoptions
- The comparison parameterpublic int replaceInLine(java.lang.String matchString, java.lang.String newValue, boolean caseSensitive, boolean wholeWord)
replaceInLine
in interface IDocument
matchString
- The matchString.newValue
- The newValue.caseSensitive
- if it specifies case sensative newValue, set to wholeWord
- if it specifies only whole word will be replaced, set to public int replaceInLine(java.util.regex.Pattern pattern, java.lang.String newValue)
replaceInLine
in interface IDocument
pattern
- The pattern.newValue
- The newValue.
public int replaceInLine(java.lang.String matchString, TextSelection matchSelection, boolean caseSensitive, boolean wholeWord)
replaceInLine
in interface IDocument
matchString
- The matchString.matchSelection
- The matchSelection.caseSensitive
- if it is case sensitive newValue, set to wholeWord
- if it replaces only whole word, set to public int replaceInLine(java.util.regex.Pattern pattern, TextSelection matchSelection)
replaceInLine
in interface IDocument
pattern
- The pattern.matchSelection
- The matchSelection.
public TextSelection findString(BodyRegion start, java.lang.String matchString, boolean caseSensitive, boolean wholeWord)
findString
in interface IDocument
start
- Search starts.matchString
- The string to find.caseSensitive
- if it specifies case sensitive search, set to wholeWord
- if it search for the whole word, set to public TextSelection findPattern(BodyRegion start, java.util.regex.Pattern pattern)
findPattern
in interface IDocument
start
- Search startspattern
- The pattern.
public TextSelection[] findStringInLine(BodyRegion start, java.lang.String matchString, boolean caseSensitive, boolean wholeWord)
findStringInLine
in interface IDocument
start
- Search start.matchString
- The matchString.caseSensitive
- if it is case sensitive search, set to wholeWord
- if it search for whole word, set to public TextSelection[] findPatternInLine(BodyRegion start, java.util.regex.Pattern pattern)
findPatternInLine
in interface IDocument
start
- Search start.pattern
- The pattern.
public void resetFindState()
resetFindState
in interface IDocument
public ParagraphBase createParagraphItem(ParagraphItemType itemType)
itemType
- Paragraph item type
public void clearMacros()
public void setDateTimeOfUnitTest(java.util.Date dateTime)
dateTime
- The date and time used in the test document.public void resetPageLayoutCache()
public void setCustomFontsFolders(java.lang.String fontPath)
fontPath
- public void clearCustomFontsFolders()
public static void setGlobalCustomFontsFolders(java.lang.String fontPath)
fontPath
- the folder path.public static void setGlobalCustomFontsFolders(java.io.InputStream[] fontStreamList)
fontStreamList
- The custom font stream array.public static void clearGlobalCustomFontsFolders()
public static void clearSystemFontCache()
public void updatePageLayout()
public void updateTableLayout()
public FileFormat getOriginalFileFormat()
public void cleanup()
public void cleanup(CleanupOptions options)
public boolean getForceTableRelayout()
public void setForceTableRelayout(boolean value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |