Package com.independentsoft.office
Class OfficeDocument
java.lang.Object
com.independentsoft.office.OfficeDocument
The Class OfficeDocument.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ApplicationPropertyprotected ContentTypeTableprotected CorePropertyprotected FileTableprotected CustomPropertiesprotected Relationshipprotected FileTableprotected byte[]protected Stringprotected Stringprotected ZipOutputStreamprotected Relationshipprotected Themeprotected Charset -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidGets the name of the application that created the document.Gets the version of the application that created the document.abstract byte[]getBytes()Gets the bytes.Gets the category of the document.intGets the total number of characters in the document.Gets the name of a company associated with the document.Gets status of the content.Gets type of content represented, generally defined by a specific use and intended audience.Gets content types table.Gets date and time of creation of the document.Gets entity primarily responsible for making the content of the document.Gets table with documents custom files.Gets the custom properties.Gets explanation of the content of the document.Gets the signature of a digitally signed document.intGets the security level of the document as a numeric value.Gets heading pairs.Gets the number of hidden slides in a presentation document.Gets the set of hyperlinks that were in the document when last saved.Gets unambiguous reference to the document within a given context.Gets table with all input files.abstract InputStreamGets the input stream.Gets delimited set of keywords to support searching and indexing.Gets the language of the intellectual content of the document.intGets the last count of the number of characters (including spaces) in the document.Gets user who performed the last modification.Gets date and time of the last printing.intGets the total number of lines in the document.byte[]getMacro()Gets the macro.Gets the main document folder name.Gets the name of a supervisor associated with the document.Gets date and time on which the document was changed.intGets the total number of sound or video clips that are present in the document.intGets the number of slides in a presentation containing notes.intGets the total number of pages of the document.intGets the total number of paragraphs found in the document.Gets the title of each document.Gets the intended format for a presentation document.Gets the base string used for evaluating relative hyperlinks in this document.Gets the revision number.Gets the topic of the content of the document.Gets name of an external document template containing format and style information used to create the document.getTheme()Gets document's themes.getTitle()Gets the name given to the document.longGets total time the document has been edited.Gets the version number.intGets the total number of words of the document.booleanIndicates the display mode of the document thumbnail.booleanThis element specifies that one or more hyperlinks in this part were updated exclusively in this part by a producer.booleanIndicates whether hyperlinks in the document are up-to-date.booleanIndicates if this document is currently shared between multiple producers.abstract voidopen(InputStream stream)Open.abstract voidOpen.protected voidopenImplementation(InputStream stream)abstract voidsave(OutputStream stream)Save.abstract voidSave.abstract voidSave.voidsetApplicationName(String applicationName)Sets the name of the application that created the document.voidsetApplicationVersion(String applicationVersion)Sets the version of the application that created the document.voidsetCategory(String category)Sets the category of the document.voidsetCharacterCount(int characterCount)Sets the total number of characters in the document.voidsetCompany(String company)Sets the name of a company associated with the document.voidsetContentStatus(String contentStatus)Sets status of the content.voidsetContentType(String contentType)Sets type of content represented, generally defined by a specific use and intended audience.voidsetCreated(Date created)Sets date and time of creation of the document.voidsetCreator(String creator)Sets entity primarily responsible for making the content of the document.voidsetDescription(String description)Sets explanation of the content of the document.voidsetDigitalSignature(String digitalSignature)Sets the signature of a digitally signed document.voidsetDocumentSecurity(int documentSecurity)Sets the security level of the document as a numeric value.voidsetEnableScaling(boolean enableScaling)Indicates the display mode of the document thumbnail.voidsetHeadingPairs(String headingPairs)Sets heading pairs.voidsetHiddenSlideCount(String hiddenSlideCount)Sets the number of hidden slides in a presentation document.voidsetHyperlinkList(String hyperlinkList)Sets the set of hyperlinks that were in the document when last saved.voidsetHyperlinksChanged(boolean hyperlinksChanged)This element specifies that one or more hyperlinks in this part were updated exclusively in this part by a producer.voidsetIdentifier(String identifier)Sets unambiguous reference to the document within a given context.voidsetKeywords(String keywords)Sets delimited set of keywords to support searching and indexing.voidsetLanguage(String language)Sets the language of the intellectual content of the document.voidsetLastCharacterCount(int lastCharacterCount)Sets the last count of the number of characters (including spaces) in the document.voidsetLastModifiedBy(String lastModifiedBy)Sets user who performed the last modification.voidsetLastPrinted(Date lastPrinted)Sets date and time of the last printing.voidsetLineCount(int lineCount)Sets the total number of lines in the document.voidsetLinksUpToDate(boolean linksUpToDate)Indicates whether hyperlinks in the document are up-to-date.voidsetMacro(byte[] macro)Sets the macro.voidsetManager(String manager)Sets the name of a supervisor associated with the document.voidsetModified(Date modified)Sets date and time on which the document was changed.voidsetMultimediaClipCount(int multimediaClipCount)Sets the total number of sound or video clips that are present in the document.voidsetNoteCount(int noteCount)Sets the number of slides in a presentation containing notes.voidsetPageCount(int pageCount)Sets the total number of pages of the document.voidsetParagraphCount(int paragraphCount)Sets the total number of paragraphs found in the document.voidsetPartTitles(String partTitles)Sets the title of each document.voidsetPresentationFormat(String presentationFormat)Sets the intended format for a presentation document.voidsetRelativeHyperlinkBase(String relativeHyperlinkBase)Sets the base string used for evaluating relative hyperlinks in this document.voidsetRevision(String revision)Sets the revision number.voidsetSharedDocument(boolean sharedDocument)Indicates if this document is currently shared between multiple producers.voidsetSubject(String subject)Sets the topic of the content of the document.voidsetTemplateName(String templateName)Sets name of an external document template containing format and style information used to create the document.voidSets document's themes.voidSets the name given to the document.voidsetTotalTime(long totalTime)Sets total time the document has been edited.voidsetVersion(String version)Sets the version number.voidsetWordCount(int totalTime)Sets the total number of words of the document.
-
Field Details
-
utf8
-
outputStream
-
contentTypeTable
-
packageRelationship
-
documentRelationship
-
coreProperty
-
applicationProperty
-
customProperties
-
theme
-
inputFileTable
-
customFileTable
-
macro
protected byte[] macro -
mainDocumentFolderName
-
mainDocumentFileName
-
-
Constructor Details
-
OfficeDocument
public OfficeDocument()
-
-
Method Details
-
open
Open.- Parameters:
file- the file- Throws:
IOException- Signals that an I/O exception has occurred.XMLStreamException- the xML stream exception
-
open
Open.- Parameters:
stream- the stream- Throws:
IOException- Signals that an I/O exception has occurred.XMLStreamException- the xML stream exception
-
save
Save.- Parameters:
file- the file- Throws:
IOException- Signals that an I/O exception has occurred.
-
save
Save.- Parameters:
file- the fileoverwrite- the overwrite- Throws:
IOException- Signals that an I/O exception has occurred.
-
save
Save.- Parameters:
stream- the stream- Throws:
IOException- Signals that an I/O exception has occurred.
-
getBytes
Gets the bytes.- Returns:
- the bytes
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getInputStream
Gets the input stream.- Returns:
- the input stream
- Throws:
IOException- Signals that an I/O exception has occurred.
-
openImplementation
- Throws:
IOExceptionXMLStreamException
-
addFile
- Throws:
IOException
-
addFile
- Throws:
IOException
-
getTheme
Gets document's themes.- Returns:
- Theme
-
setTheme
Sets document's themes.- Parameters:
theme- the new theme
-
getContentTypeTable
Gets content types table.- Returns:
- ContentTypeTable
-
getInputFileTable
Gets table with all input files. It allows you to get files from the document.- Returns:
- FileTable
-
getCustomFileTable
Gets table with documents custom files. It allows you to add files to the document and save them together with document.- Returns:
- FileTable
-
getCategory
Gets the category of the document. Example values for this property might include: Resume, Letter, Technical Presentation, and so on.- Returns:
- String
-
setCategory
Sets the category of the document. Example values for this property might include: Resume, Letter, Technical Presentation, and so on.- Parameters:
category- the new category
-
getContentStatus
Gets status of the content. Example values for this property might include: "Draft", "Reviewed", "Final", and so on.- Returns:
- String
-
setContentStatus
Sets status of the content. Example values for this property might include: "Draft", "Reviewed", "Final", and so on.- Parameters:
contentStatus- the new content status
-
getContentType
Gets type of content represented, generally defined by a specific use and intended audience. This property is distinct from MIME content types as defined in RFC 2616.- Returns:
- String
-
setContentType
Sets type of content represented, generally defined by a specific use and intended audience. This property is distinct from MIME content types as defined in RFC 2616.- Parameters:
contentType- the new content type
-
getCreated
Gets date and time of creation of the document.- Returns:
- Date
-
setCreated
Sets date and time of creation of the document.- Parameters:
created- the new created
-
getCreator
Gets entity primarily responsible for making the content of the document.- Returns:
- String
-
setCreator
Sets entity primarily responsible for making the content of the document.- Parameters:
creator- the new creator
-
getDescription
Gets explanation of the content of the document.- Returns:
- String
-
setDescription
Sets explanation of the content of the document.- Parameters:
description- the new description
-
getIdentifier
Gets unambiguous reference to the document within a given context.- Returns:
- String
-
setIdentifier
Sets unambiguous reference to the document within a given context.- Parameters:
identifier- the new identifier
-
getKeywords
Gets delimited set of keywords to support searching and indexing. This is typically a list of terms that are not available elsewhere in the properties.- Returns:
- String
-
setKeywords
Sets delimited set of keywords to support searching and indexing. This is typically a list of terms that are not available elsewhere in the properties.- Parameters:
keywords- the new keywords
-
getLanguage
Gets the language of the intellectual content of the document. RFC 3066 provides guidance on encoding to represent languages.- Returns:
- String
-
setLanguage
Sets the language of the intellectual content of the document. RFC 3066 provides guidance on encoding to represent languages.- Parameters:
language- the new language
-
getLastModifiedBy
Gets user who performed the last modification. Example values for this property might include: A name, email address, employee ID, and so on.- Returns:
- String
-
setLastModifiedBy
Sets user who performed the last modification. Example values for this property might include: A name, email address, employee ID, and so on.- Parameters:
lastModifiedBy- the new last modified by
-
getLastPrinted
Gets date and time of the last printing.- Returns:
- Date
-
setLastPrinted
Sets date and time of the last printing.- Parameters:
lastPrinted- the new last printed
-
getModified
Gets date and time on which the document was changed.- Returns:
- Date
-
setModified
Sets date and time on which the document was changed.- Parameters:
modified- the new modified
-
getRevision
Gets the revision number.- Returns:
- String
-
setRevision
Sets the revision number.- Parameters:
revision- the new revision
-
getSubject
Gets the topic of the content of the document.- Returns:
- String
-
setSubject
Sets the topic of the content of the document.- Parameters:
subject- the new subject
-
getTitle
Gets the name given to the document.- Returns:
- String
-
setTitle
Sets the name given to the document.- Parameters:
title- the new title
-
getVersion
Gets the version number.- Returns:
- String
-
setVersion
Sets the version number.- Parameters:
version- the new version
-
getApplicationName
Gets the name of the application that created the document.- Returns:
- String
-
setApplicationName
Sets the name of the application that created the document.- Parameters:
applicationName- the new application name
-
getApplicationVersion
Gets the version of the application that created the document.- Returns:
- String
-
setApplicationVersion
Sets the version of the application that created the document.- Parameters:
applicationVersion- the new application version
-
getCharacterCount
public int getCharacterCount()Gets the total number of characters in the document.- Returns:
- int
-
setCharacterCount
public void setCharacterCount(int characterCount)Sets the total number of characters in the document.- Parameters:
characterCount- the new character count
-
getLastCharacterCount
public int getLastCharacterCount()Gets the last count of the number of characters (including spaces) in the document.- Returns:
- int
-
setLastCharacterCount
public void setLastCharacterCount(int lastCharacterCount)Sets the last count of the number of characters (including spaces) in the document.- Parameters:
lastCharacterCount- the new last character count
-
getCompany
Gets the name of a company associated with the document.- Returns:
- String
-
setCompany
Sets the name of a company associated with the document.- Parameters:
company- the new company
-
getDigitalSignature
Gets the signature of a digitally signed document.- Returns:
- String
-
setDigitalSignature
Sets the signature of a digitally signed document.- Parameters:
digitalSignature- the new digital signature
-
getDocumentSecurity
public int getDocumentSecurity()Gets the security level of the document as a numeric value.- Returns:
- int
-
setDocumentSecurity
public void setDocumentSecurity(int documentSecurity)Sets the security level of the document as a numeric value.- Parameters:
documentSecurity- the new document security
-
getHeadingPairs
Gets heading pairs. Heading pairs indicates the grouping of document parts and the number of parts in each group. These parts are not document parts but conceptual representations of document sections.- Returns:
- String
-
setHeadingPairs
Sets heading pairs. Heading pairs indicates the grouping of document parts and the number of parts in each group. These parts are not document parts but conceptual representations of document sections.- Parameters:
headingPairs- the new heading pairs
-
getHiddenSlideCount
Gets the number of hidden slides in a presentation document.- Returns:
- String
-
setHiddenSlideCount
Sets the number of hidden slides in a presentation document.- Parameters:
hiddenSlideCount- the new hidden slide count
-
getHyperlinkList
Gets the set of hyperlinks that were in the document when last saved.- Returns:
- String
-
setHyperlinkList
Sets the set of hyperlinks that were in the document when last saved.- Parameters:
hyperlinkList- the new hyperlink list
-
getRelativeHyperlinkBase
Gets the base string used for evaluating relative hyperlinks in this document.- Returns:
- String
-
setRelativeHyperlinkBase
Sets the base string used for evaluating relative hyperlinks in this document.- Parameters:
relativeHyperlinkBase- the new relative hyperlink base
-
hasHyperlinksChanged
public boolean hasHyperlinksChanged()This element specifies that one or more hyperlinks in this part were updated exclusively in this part by a producer. The next producer to open this document shall update the hyperlink relationships with the new hyperlinks specified in this part.- Returns:
- boolean
-
setHyperlinksChanged
public void setHyperlinksChanged(boolean hyperlinksChanged)This element specifies that one or more hyperlinks in this part were updated exclusively in this part by a producer. The next producer to open this document shall update the hyperlink relationships with the new hyperlinks specified in this part.- Parameters:
hyperlinksChanged- the new hyperlinks changed
-
getLineCount
public int getLineCount()Gets the total number of lines in the document.- Returns:
- int
-
setLineCount
public void setLineCount(int lineCount)Sets the total number of lines in the document.- Parameters:
lineCount- the new line count
-
hasLinksUpToDate
public boolean hasLinksUpToDate()Indicates whether hyperlinks in the document are up-to-date. Set this element to TRUE to indicate that hyperlinks are updated. Set this element to FALSE to indicate that hyperlinks are outdated.- Returns:
- boolean
-
setLinksUpToDate
public void setLinksUpToDate(boolean linksUpToDate)Indicates whether hyperlinks in the document are up-to-date. Set this element to TRUE to indicate that hyperlinks are updated. Set this element to FALSE to indicate that hyperlinks are outdated.- Parameters:
linksUpToDate- the new links up to date
-
getManager
Gets the name of a supervisor associated with the document.- Returns:
- String
-
setManager
Sets the name of a supervisor associated with the document.- Parameters:
manager- the new manager
-
getMultimediaClipCount
public int getMultimediaClipCount()Gets the total number of sound or video clips that are present in the document.- Returns:
- int
-
setMultimediaClipCount
public void setMultimediaClipCount(int multimediaClipCount)Sets the total number of sound or video clips that are present in the document.- Parameters:
multimediaClipCount- the new multimedia clip count
-
getNoteCount
public int getNoteCount()Gets the number of slides in a presentation containing notes.- Returns:
- int
-
setNoteCount
public void setNoteCount(int noteCount)Sets the number of slides in a presentation containing notes.- Parameters:
noteCount- the new note count
-
getPageCount
public int getPageCount()Gets the total number of pages of the document.- Returns:
- int
-
setPageCount
public void setPageCount(int pageCount)Sets the total number of pages of the document.- Parameters:
pageCount- the new page count
-
getParagraphCount
public int getParagraphCount()Gets the total number of paragraphs found in the document.- Returns:
- int
-
setParagraphCount
public void setParagraphCount(int paragraphCount)Sets the total number of paragraphs found in the document.- Parameters:
paragraphCount- the new paragraph count
-
getPresentationFormat
Gets the intended format for a presentation document.- Returns:
- String
-
setPresentationFormat
Sets the intended format for a presentation document.- Parameters:
presentationFormat- the new presentation format
-
hasEnableScaling
public boolean hasEnableScaling()Indicates the display mode of the document thumbnail. Set this element to TRUE to enable scaling of the document thumbnail to the display. Set this element to FALSE to enable cropping of the document thumbnail to show only sections that will fit the display.- Returns:
- boolean
-
setEnableScaling
public void setEnableScaling(boolean enableScaling)Indicates the display mode of the document thumbnail. Set this element to TRUE to enable scaling of the document thumbnail to the display. Set this element to FALSE to enable cropping of the document thumbnail to show only sections that will fit the display.- Parameters:
enableScaling- the new enable scaling
-
getTemplateName
Gets name of an external document template containing format and style information used to create the document.- Returns:
- String
-
setTemplateName
Sets name of an external document template containing format and style information used to create the document.- Parameters:
templateName- the new template name
-
getPartTitles
Gets the title of each document.- Returns:
- String
-
setPartTitles
Sets the title of each document.- Parameters:
partTitles- the new part titles
-
getTotalTime
public long getTotalTime()Gets total time the document has been edited. The default time unit is minutes.- Returns:
- long
-
setTotalTime
public void setTotalTime(long totalTime)Sets total time the document has been edited. The default time unit is minutes.- Parameters:
totalTime- the new total time
-
getWordCount
public int getWordCount()Gets the total number of words of the document.- Returns:
- int
-
setWordCount
public void setWordCount(int totalTime)Sets the total number of words of the document.- Parameters:
totalTime- the new word count
-
getCustomProperties
Gets the custom properties.- Returns:
- the custom properties
-
getMacro
public byte[] getMacro()Gets the macro.- Returns:
- the macro
-
setMacro
public void setMacro(byte[] macro)Sets the macro.- Parameters:
macro- the new macro
-
getMainDocumentFolderName
Gets the main document folder name.- Returns:
- the main document folder name
-