Click or drag to resize

Document Class

Inheritance Hierarchy

Namespace:  Spire.Doc
Assembly:  Spire.Doc (in Spire.Doc.dll) Version: 9.10.0.0 (9.10.0.3040)
Syntax
public class Document : DocumentContainer, IDocument, 
	ICompositeObject, IDocumentObject, IXmlSerializable, IDisposable

The Document type exposes the following members.

Constructors
  NameDescription
Public methodDocument
Initializes a new instance of the Document class
Public methodDocument(Stream)
Initializes a new instance of the Document class
Public methodDocument(String)
Initializes a new instance of the Document class
Protected methodDocument(Document)
Initializes a new instance of the Document class
Public methodDocument(Stream, FileFormat)
Initializes a new instance of the Document class
Public methodDocument(Stream, String)
Initializes a new instance of the Document class
Public methodDocument(String, FileFormat)
Initializes a new instance of the Document class
Public methodDocument(String, String)
Initializes a new instance of the Document class
Public methodDocument(Stream, FileFormat, XHTMLValidationType)
Initializes a new instance of the Document class
Public methodDocument(Stream, FileFormat, String)
Initializes a new instance of the Document class
Public methodDocument(String, FileFormat, XHTMLValidationType)
Initializes a new instance of the Document class
Public methodDocument(String, FileFormat, String)
Initializes a new instance of the Document class
Top
Properties
  NameDescription
Public propertyBackground
Gets document's background
Public propertyBookmarks
Gets document bookmarks.
Public propertyBuiltinDocumentProperties
Gets document built-in properties object.
Public propertyChildObjects
Gets the child entities.
(Overrides DocumentObjectChildObjects.)
Public propertyComments
Gets comments item of the document.
Public propertyCount
Gets count of child object.
(Inherited from DocumentContainer.)
Public propertyCustomDocumentProperties
Gets document custom properties object.
Public propertyDetectedFormatType
Returns the detected format type of the document which was loaded. .
Public propertyDocument
Gets the document.
(Inherited from OwnerHolder.)
Public propertyDocumentObjectType
Gets the type of the document object.
(Overrides DocumentObjectDocumentObjectType.)
Public propertyEmbedFontsInFile
Gets or sets a value indicating whether save fonts that are used in the document in the file. Only support for the DOCX file format.
Public propertyEmbedSystemFonts
Gets or sets a value indicating whether save system fonts that are used in the document in the file.
Public propertyEndnoteOptions
Gets or sets options that control numbering and positioning of endnotes in this document.
Public propertyEndnotes
Gets document endnotes.
Public propertyFields
Gets fields of the documnet.
Public propertyFirstChild (Inherited from DocumentObject.)
Public propertyFootnoteOptions
Gets or sets options that control numbering and positioning of footnotes in this document.
Public propertyFootnotes
Gets document footnotes.
Public propertyHasChanges
Gets a value indicating whether the document has tracked changes.
Public propertyHtmlBaseUrl
Gets or sets the Base path which is used to convert the relative path to absolute path.
Public propertyHTMLCustomComment

Gets or 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.

Public propertyHtmlExportOptions
Gets the save options.
Public propertyHTMLIdentifierPunctuations
Set the custom punctuation as sentence indentifier. Full stop, qusetion mark, exclamatory mark are default values.
Public propertyHTMLSentenceIdentifier

Gets or 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).

Public propertyHTMLTrackChanges

Gets or 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.

Public propertyIsComposite
Indicating whether this instance is composite.
(Inherited from DocumentObject.)
Public propertyIsContainMacro
Indicates whether the document has macros.
Public propertyIsUpdateFields
Gets or sets a value indicating whether to update fields in the document.
Public propertyJPEGQuality
Gets/sets the quality (Q%) of the image of JPEG format, this property is only used for doc to pdf. The default value is 80.
Public propertyKeepSameFormat
Gets or sets a value that indicates whether to keep same formatting when it is merged to other document.
Public propertyLastChild (Inherited from DocumentObject.)
Public propertyLastParagraph
Gets last section object.
Public propertyLastSection
Gets last section of the document.
Public propertyListStyles
Gets document list styles.
Public propertyMailMerge
Gets mail merge engine.
Public propertyNextSibling
Gets the next sibling.
(Inherited from DocumentObject.)
Public propertyOwner
Gets the owner of this entity.
(Inherited from DocumentObject.)
Public propertyPageCount
Gets total number of pages for document.
Public propertyPreviousSibling
Gets the previous sibling.
(Inherited from DocumentObject.)
Public propertyPrintDialog
Set print parnameters
Public propertyPrintDocument
Gets the PrintDocument
Public propertyPrivateFontList
Gets the private font list.
Public propertyProperties
Gets the document properties.
Public propertyProtectionType
Gets or sets the type of protection of the document.
Public propertyQuiteMode
Get / sets whether is quite mode.
Public propertyReplaceFirst
Gets or sets a value indicating whether need first replacing.
Public propertySections
Gets document sections.
Public propertyStyles
Gets document styles.
Public propertyTextBoxes
Get/set textbox items of main document
Public propertyTOC
Gets or sets the TOC element of the word document.
Public propertyTrackChanges
Gets or sets a value indicating whether tracking changes is turn on.
Public propertyUseNewEngine
Use new engine.
Public propertyVariables
Gets or sets the document variables.
Public propertyViewSetup
Gets view setup options in Microsoft word.
Public propertyWatermark
Gets or sets document's watermark.
Protected propertyWidgetCollection (Overrides DocumentContainerWidgetCollection.)
Protected propertyXDLSHolder (Inherited from DocumentSerializable.)
Public propertyXHTMLValidateOption
Gets or sets the HTML validate option.the default value is None.
Top
Methods
  NameDescription
Public methodAcceptChanges
Accepts changes tracked from the moment of last change acceptance.
Public methodAddListStyle
Adds new list style to document.
Public methodAddParagraphStyle
Adds new paragraph style to the document.
Public methodAddSection
Adds new section to document.
Public methodAddStyle
Adds the style to the document style.
Public methodcheckProtectionPassWord
Check that the password entered is the same as the permission protection password
Public methodClearMacros
Removes the macros from the document.
Public methodClone
Clones itself.
Public methodCloneCompatibilityTo
Clones the current document compatibility to the destination document.
Public methodCloneDefaultStyleTo
Clones the current document default style to the destination document.
Protected methodCloneImpl (Overrides DocumentSerializableCloneImpl.)
Public methodCloneThemesTo
Clones the current document theme style to the destination document.
Public methodCloneWebSettingsTo
clone Websettings to other document
Public methodClose
Closes this instance.
Public methodCompare(Document, String)
Compares this document with another document.
Public methodCompare(Document, String, DateTime)
Compares this document with another document.
Protected methodCreateCellFormatImpl
Protected methodCreateCharacterFormatImpl
Protected methodCreateLayoutInfo (Overrides DocumentBaseCreateLayoutInfo.)
Protected methodCreateListFormatImpl
Protected methodCreateListLevelImpl
Protected methodCreateListStyleImpl
Public methodCreateMinialDocument
Create a minial document, one empty section to the document and one empty paragraph to created section.
Public methodCreateParagraph
Creates the paragraph.
Protected methodCreateParagraphFormatImpl
Public methodCreateParagraphItem
Creates new paragraph item instance.
Protected methodCreateTableFormatImpl
Protected methodCreateTextBoxCollectionImpl
Protected methodCreateTextboxFormatImpl
Public methodDispose
Prerforms application-defined tasks associated with freeing,releasing, or resetting unmanaged resources.
Public methodEncrypt
Encrypts the document.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodFindAllPattern
Returns all entries of matchString regex.
Public methodFindAllString
Returns all entries of matchString string, taking into consideration caseSensitive and wholeWord options.
Public methodFindPattern(Regex)
Finds and returns entry of specified regular expression along with formatting.
Public methodFindPattern(BodyRegion, Regex)
Finds the next entry of matchString pattern.
Public methodFindPatternInLine(Regex)
Finds the first entry of specified pattern in single-line mode.
Public methodFindPatternInLine(BodyRegion, Regex)
Finds the text which fit the specified pattern starting from start. using single-line mode.
Public methodFindString(String, Boolean, Boolean)
Finds and returns string along with formatting.
Public methodFindString(BodyRegion, String, Boolean, Boolean)
Finds the next entry of matchString string, taking into consideration caseSensitive and wholeWord options.
Public methodFindStringInLine(String, Boolean, Boolean)
Finds the first entry of matchString text in single-line mode.
Public methodFindStringInLine(BodyRegion, String, Boolean, Boolean)
Finds the next matchString text starting from specified using single-line mode.
Public methodGetHashCode (Inherited from Object.)
Public methodGetIndex (Inherited from DocumentContainer.)
Public methodGetNextWidgetSibling (Inherited from DocumentObject.)
Public methodGetPageCount
Gets total number of pages for document.
Public methodGetPreviousWidgetSibling (Inherited from DocumentObject.)
Protected methodGetSchema
Public methodGetText
Gets the document's text.
Public methodGetType (Inherited from Object.)
Public methodImportContent(IDocument)
Imports all content into the document.
Public methodImportContent(IDocument, Boolean)
Imports all content into document.
Public methodImportSection
Imports section into document.
Protected methodInitXDLSHolder (Overrides DocumentSerializableInitXDLSHolder.)
Public methodInsertTextFromFile
Insert text from a file.
Public methodInsertTextFromStream
Insert text from stream.
Public methodLoadFromFile(String)
Opens doc file.
Public methodLoadFromFile(String, FileFormat)
Opens the document from file in Xml or Microsoft Word format.
Public methodLoadFromFile(String, FileFormat, XHTMLValidationType)
Opens the HTML document from stream .
Public methodLoadFromFile(String, FileFormat, String)
Opens the document from file in Xml or Microsoft Word format.
Public methodLoadFromFileInReadMode
LoadFromStream new document in read-only mode.
Public methodLoadFromStream(Stream, FileFormat)
Opens the document from stream in Xml or Microsoft Word format.
Public methodLoadFromStream(Stream, FileFormat, XHTMLValidationType)
Opens the HTML document from stream .
Public methodLoadFromStream(Stream, FileFormat, String)
Opens the document from stream in Xml or Microsoft Word format.
Public methodLoadHTML(TextReader, XHTMLValidationType)
Load document in html format
Public methodLoadHTML(TextReader, String, XHTMLValidationType)
Load document in html format
Public methodLoadRtf(Stream)
Opens the rtf document from a stream.
Public methodLoadRtf(TextReader)
Opens the rtf document with specified encoding from a reader.
Public methodLoadRtf(String)
Opens the rtf document from a file.
Public methodLoadRtf(Stream, Encoding)
Opens the rtf document with specified encoding from a stream.
Public methodLoadRtf(String, Encoding)
Opens the rtf document with specified encoding from a file.
Public methodLoadText(Stream)
Opens the text document from a stream with default encoding utf-8.
Public methodLoadText(TextReader)
Opens the rtf document with specified encoding from a reader.
Public methodLoadText(String)
Opens the text document from a file with default encoding utf-8.
Public methodLoadText(Stream, Encoding)
Opens the text document with specified encoding from a stream.
Public methodLoadText(String, Encoding)
Opens the text document with specified encoding from a file.
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodOnBeginPrint
Protected methodOnEndPrint
Protected methodOnPrintPage
Protected methodOnQueryPageSettings
Public methodProtect(ProtectionType)
Protects the document.
Public methodProtect(ProtectionType, String)
Protects the document.
Protected methodReadXmlAttributes (Overrides DocumentSerializableReadXmlAttributes(IXDLSAttributeReader).)
Protected methodReadXmlContent (Overrides DocumentSerializableReadXmlContent(IXDLSContentReader).)
Public methodRejectChanges
Rejects changes tracked from the moment of last change acceptance.
Public methodRemoveEncryption
Removes the encryption.
Public methodReplace(Regex, TextSelection)
Replaces all entries of matchString regular expression with TextRangesHolder.
Public methodReplace(Regex, String)
Replaces all entries of matchString regular expression with newValue string.
Public methodReplace(String, TextSelection, Boolean, Boolean)
Replaces all entries of matchString string with TextSelection, taking into consideration caseSensitive and wholeWord options.
Public methodReplace(String, IDocument, Boolean, Boolean)
Replaces the specified matchString.
Public methodReplace(String, String, Boolean, Boolean)
Replaces all entries of matchString string with newValue string, taking into consideration caseSensitive and wholeWord options.
Public methodReplaceInLine(Regex, TextSelection)
Replaces the matchString pattern with matchSelection in single-line mode.
Public methodReplaceInLine(Regex, String)
Replaces all entries with specified pattern with newValue text in single-line mode.
Public methodReplaceInLine(String, TextSelection, Boolean, Boolean)
Replaces the matchString text with matchSelection in single-line mode.
Public methodReplaceInLine(String, String, Boolean, Boolean)
Replaces all entries of matchString text with newValue text in single-line mode.
Public methodResetFindState
Resets the FindPattern.
Protected methodRestoreReference (Inherited from DocumentSerializable.)
Public methodSaveToEpub(Stream, DocPicture)
Saves the EPUB document.
Public methodSaveToEpub(String, DocPicture)
Saves the EPUB document.
Public methodSaveToFile(String)
Saves to file in Microsoft Word format.
Public methodSaveToFile(Stream, FileFormat)
Saves the document into stream in Xml or Microsoft Word format.
Public methodSaveToFile(String, FileFormat)
Saves the document to file in Xml or Microsoft Word format.
Public methodSaveToFile(String, ToPdfParameterList)
Saves the document to PDF file.
Public methodSaveToFile(String, FileFormat, Byte, String)
Saves document to file and digitally sign, Only DOC and DOCX are supported.
Public methodSaveToFile(String, FileFormat, String, String)
Saves document to file and digitally sign, Only DOC and DOCX are supported.
Public methodSaveToFile(String, FileFormat, HttpResponse, HttpContentType)
Saves the specified file name.
Public methodSaveToImages(ImageType)
Save the whole document into images
Public methodSaveToImages(Int32, ImageType)
Save the specified page into image
Public methodSaveToImages(Int32, ImageFormat)
Save the specified page into image
Public methodSaveToImages(Int32, Int32, ImageType)
Save the specified range of pages into images
Public methodSaveToStream(Stream, FileFormat)
Saves the document into stream in Xml or Microsoft Word format.
Public methodSaveToStream(Stream, ToPdfParameterList)
Saves the document into stream.
Public methodSaveToStream(Stream, FileFormat, Byte, String)
Saves document to stream and digitally sign, Only DOC and DOCX are supported.
Public methodSaveToStream(Stream, FileFormat, String, String)
Saves document to stream and digitally sign, Only DOC and DOCX are supported.
Public methodSaveToSVG
Saves the SVG.
Public methodSaveToSVG(String)
Saves the SVG.
Public methodSaveToTxt
Saves to text document with specified encoding.
Public methodStatic memberSign(Stream, Byte, String)
Create digitally signed word document. Digital signature of documents support only DOC and DOCX formats.
Public methodStatic memberSign(Stream, String, String)
Create digitally signed word document. Digital signature of documents support only DOC and DOCX formats.
Public methodToString (Inherited from Object.)
Public methodToString(String)
Exports the name and index in container of the object into a string in the specified seperator.
(Inherited from DocumentObject.)
Public methodUpdateListLabels
Public methodUpdateTableOfContents
Update Table of contents in the document.
Public methodUpdateTableOfContents(TableOfContent)
Update specified Table of content in the document.
Public methodUpdateWordCount
Update Paragraphs count, Word count and Character count
Public methodUpdateWordCount(Char)
Update Paragraphs count, Word count and Character count.
Public methodUpdateWordCount(Char, Boolean)
Update Paragraphs count, Word count and Character count.
Protected methodWriteXmlAttributes (Overrides DocumentSerializableWriteXmlAttributes(IXDLSAttributeWriter).)
Protected methodWriteXmlContent (Overrides DocumentSerializableWriteXmlContent(IXDLSContentWriter).)
Top
Events
  NameDescription
Public eventBookmarkLayout
Occurs when draw a bookmark.
Public eventPageLayout
Occurs when creating a new page.
Public eventUpdateFields
Occurs when update field.
Top
Fields
  NameDescription
Protected fieldm_doc (Inherited from OwnerHolder.)
Protected fieldm_listStyles
Protected fieldm_sections
Protected fieldm_styles
Top
See Also