Document
Inheritance: java.lang.Object, com.aspose.note.Node, com.aspose.note.CompositeNodeBase, com.aspose.note.CompositeNode
All Implemented Interfaces: com.aspose.note.INotebookChildNode
public class Document extends CompositeNode<Page> implements INotebookChildNode
Represents an Aspose.Note document.
Constructors
Constructor | Description |
---|---|
Document() | Initializes a new instance of the Document class. |
Document(String filePath) | Initializes a new instance of the Document class. |
Document(String filePath, LoadOptions loadOptions) | Initializes a new instance of the Document class. |
Document(InputStream inStream) | Initializes a new instance of the Document class. |
Document(InputStream inStream, LoadOptions loadOptions) | Initializes a new instance of the Document class. |
Methods
Method | Description |
---|---|
accept(DocumentVisitor visitor) | Accepts the visitor of the node. |
detectLayoutChanges() | Detects all changes made to the document layout since the previous DetectLayoutChanges call. |
getAutomaticLayoutChangesDetectionEnabled() | Gets a value indicating whether Aspose.Note performs detection of layout changes automatically. |
getColor() | Gets the color. |
getCreationTime() | Gets the creation time. |
getDisplayName() | Gets the display name. |
getFileFormat() | Gets file format (OneNote 2010, OneNote Online). |
getGuid() | Gets the object’s globally unique id. |
getGuidInternal() | |
getPageHistory(Page page) | Gets the PageHistory which contains full history for each page presented in a document (the earliest at index 0). |
isEncrypted(InputStream stream, Document[] document) | Checks whether a document from a stream is encrypted. |
isEncrypted(InputStream stream, LoadOptions options, Document[] document) | Checks whether a document from a stream is encrypted. |
isEncrypted(InputStream stream, String password, Document[] document) | Checks whether a document from a stream is encrypted. |
isEncrypted(String filePath, Document[] document) | Checks whether a document from a file is encrypted. |
isEncrypted(String filePath, LoadOptions options, Document[] document) | Checks whether a document from a file is encrypted. |
isEncrypted(String filePath, String password, Document[] document) | Checks whether a document from a file is encrypted. |
print() | Prints the document using the default printer. |
print(PrintOptions options) | Prints the document using the default printer. |
print(String printerName) | Prints the document using the default printer. |
print(AttributeSet printSettings) | Prints the document using the default printer. |
save(OutputStream stream) | Saves the OneNote document to a stream. |
save(OutputStream stream, SaveOptions options) | Saves the OneNote document to a stream using the specified save options. |
save(OutputStream stream, int format) | Saves the OneNote document to a stream in the specified format. |
save(String fileName) | Saves the OneNote document to a file. |
save(String fileName, SaveOptions options) | Saves the OneNote document to a file using the specified save options. |
save(String fileName, int format) | Saves the OneNote document to a file in the specified format. |
setAutomaticLayoutChangesDetectionEnabled(boolean value) | Sets a value indicating whether Aspose.Note performs detection of layout changes automatically. |
setColor(Color value) | Sets the color. |
setCreationTime(Date value) | Sets the creation time. |
setDisplayName(String value) | Sets the display name. |
Document()
public Document()
Initializes a new instance of the Document
class. Creates a blank OneNote document.
Document(String filePath)
public Document(String filePath)
Initializes a new instance of the Document
class. Opens an existing OneNote document from a file.
Parameters:
Parameter | Type | Description |
---|---|---|
filePath | java.lang.String | The file path. |
Document(String filePath, LoadOptions loadOptions)
public Document(String filePath, LoadOptions loadOptions)
Initializes a new instance of the Document
class. Opens an existing OneNote document from a file. Allows to specify additional options such as an encryption password.
Parameters:
Parameter | Type | Description |
---|---|---|
filePath | java.lang.String | The file path. |
loadOptions | LoadOptions | Options used to load a document. Can be null. |
Document(InputStream inStream)
public Document(InputStream inStream)
Initializes a new instance of the Document
class. Opens an existing OneNote document from a stream.
Parameters:
Parameter | Type | Description |
---|---|---|
inStream | java.io.InputStream | The stream. |
Document(InputStream inStream, LoadOptions loadOptions)
public Document(InputStream inStream, LoadOptions loadOptions)
Initializes a new instance of the Document
class. Opens an existing OneNote document from a stream. Allows to specify additional options such as an encryption password.
Parameters:
Parameter | Type | Description |
---|---|---|
inStream | java.io.InputStream | The stream. |
loadOptions | LoadOptions | Options used to load a document. Can be null. |
accept(DocumentVisitor visitor)
public void accept(DocumentVisitor visitor)
Accepts the visitor of the node.
Parameters:
Parameter | Type | Description |
---|---|---|
visitor | DocumentVisitor | The object of a class derived from the DocumentVisitor . |
detectLayoutChanges()
public void detectLayoutChanges()
Detects all changes made to the document layout since the previous DetectLayoutChanges
call. In case AutomaticLayoutChangesDetectionEnabled
set to true, used automatically in the beginning of document export.
getAutomaticLayoutChangesDetectionEnabled()
public boolean getAutomaticLayoutChangesDetectionEnabled()
Gets a value indicating whether Aspose.Note performs detection of layout changes automatically. Default value is true
.
Returns: boolean
getColor()
public Color getColor()
Gets the color.
Returns: java.awt.Color
getCreationTime()
public Date getCreationTime()
Gets the creation time.
Returns: java.util.Date
getDisplayName()
public String getDisplayName()
Gets the display name.
Returns: java.lang.String
getFileFormat()
public int getFileFormat()
Gets file format (OneNote 2010, OneNote Online).
Returns: int
getGuid()
public UUID getGuid()
Gets the object’s globally unique id.
Returns: java.util.UUID
getGuidInternal()
public System.Guid getGuidInternal()
Returns: com.aspose.ms.System.Guid
getPageHistory(Page page)
public PageHistory getPageHistory(Page page)
Gets the PageHistory
which contains full history for each page presented in a document (the earliest at index 0). The current page revision can be accessed as PageHistory.current
and contained separately from collection of historical versions.
Parameters:
Parameter | Type | Description |
---|---|---|
page | Page | The current revision of a page. |
Returns:
PageHistory - The PageHistory
.
isEncrypted(InputStream stream, Document[] document)
public static boolean isEncrypted(InputStream stream, Document[] document)
Checks whether a document from a stream is encrypted. To check it we need to completely load this document. So this method can lead to performance penalty.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.InputStream | The stream. |
document | Document[] | The loaded document. |
Returns: boolean - Returns true if the document is encrypted otherwise false.
isEncrypted(InputStream stream, LoadOptions options, Document[] document)
public static boolean isEncrypted(InputStream stream, LoadOptions options, Document[] document)
Checks whether a document from a stream is encrypted. To check it we need to completely load this document. So this method can lead to performance penalty.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.InputStream | The stream. |
options | LoadOptions | The load options. |
document | Document[] | The loaded document. |
Returns: boolean - Returns true if the document is encrypted otherwise false.
isEncrypted(InputStream stream, String password, Document[] document)
public static boolean isEncrypted(InputStream stream, String password, Document[] document)
Checks whether a document from a stream is encrypted. To check it we need to completely load this document. So this method can lead to performance penalty.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.InputStream | The stream. |
password | java.lang.String | The password to decrypt a document. |
document | Document[] | The loaded document. |
Returns: boolean - Returns true if the document is encrypted otherwise false.
isEncrypted(String filePath, Document[] document)
public static boolean isEncrypted(String filePath, Document[] document)
Checks whether a document from a file is encrypted. To check it we need to completely load this document. So this method can lead to performance penalty.
Parameters:
Parameter | Type | Description |
---|---|---|
filePath | java.lang.String | The file path. |
document | Document[] | The loaded document. |
Returns: boolean - Returns true if the document is encrypted otherwise false.
isEncrypted(String filePath, LoadOptions options, Document[] document)
public static boolean isEncrypted(String filePath, LoadOptions options, Document[] document)
Checks whether a document from a file is encrypted. To check it we need to completely load this document. So this method can lead to performance penalty.
Parameters:
Parameter | Type | Description |
---|---|---|
filePath | java.lang.String | The file path. |
options | LoadOptions | The load options. |
document | Document[] | The loaded document. |
Returns: boolean - Returns true if the document is encrypted otherwise false.
isEncrypted(String filePath, String password, Document[] document)
public static boolean isEncrypted(String filePath, String password, Document[] document)
Checks whether a document from a file is encrypted. To check it we need to completely load this document. So this method can lead to performance penalty.
Parameters:
Parameter | Type | Description |
---|---|---|
filePath | java.lang.String | The file path. |
password | java.lang.String | The password to decrypt a document. |
document | Document[] | The loaded document. |
Returns: boolean - Returns true if the document is encrypted otherwise false.
print()
public void print()
Prints the document using the default printer.
print(PrintOptions options)
public void print(PrintOptions options)
Prints the document using the default printer.
Parameters:
Parameter | Type | Description |
---|---|---|
options | PrintOptions | Options used to print a document. Can be null. |
print(String printerName)
public void print(String printerName)
Prints the document using the default printer.
Parameters:
Parameter | Type | Description |
---|---|---|
printerName | java.lang.String |
print(AttributeSet printSettings)
public void print(AttributeSet printSettings)
Prints the document using the default printer.
Parameters:
Parameter | Type | Description |
---|---|---|
printSettings | javax.print.attribute.AttributeSet |
save(OutputStream stream)
public void save(OutputStream stream)
Saves the OneNote document to a stream.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.OutputStream | The System.iO.stream where the document will be saved. |
save(OutputStream stream, SaveOptions options)
public void save(OutputStream stream, SaveOptions options)
Saves the OneNote document to a stream using the specified save options.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.OutputStream | The System.iO.stream where the document will be saved. |
options | SaveOptions | Specifies the options how the document is saved in stream. |
save(OutputStream stream, int format)
public void save(OutputStream stream, int format)
Saves the OneNote document to a stream in the specified format.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.OutputStream | The System.iO.stream where the document will be saved. |
format | int | The format in which to save the document. |
save(String fileName)
public void save(String fileName)
Saves the OneNote document to a file.
Parameters:
Parameter | Type | Description |
---|---|---|
fileName | java.lang.String | The full name for the file. If a file with the specified full name already exists, the existing file is overwritten. |
save(String fileName, SaveOptions options)
public void save(String fileName, SaveOptions options)
Saves the OneNote document to a file using the specified save options.
Parameters:
Parameter | Type | Description |
---|---|---|
fileName | java.lang.String | The full name for the file. If a file with the specified full name already exists, the existing file is overwritten. |
options | SaveOptions | Specifies the options how the document is saved in file. |
save(String fileName, int format)
public void save(String fileName, int format)
Saves the OneNote document to a file in the specified format.
Parameters:
Parameter | Type | Description |
---|---|---|
fileName | java.lang.String | The full name for the file. If a file with the specified full name already exists, the existing file is overwritten. |
format | int | The format in which to save the document. |
setAutomaticLayoutChangesDetectionEnabled(boolean value)
public void setAutomaticLayoutChangesDetectionEnabled(boolean value)
Sets a value indicating whether Aspose.Note performs detection of layout changes automatically.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | New value. Can be null. |
setColor(Color value)
public void setColor(Color value)
Sets the color.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.awt.Color | Color’s value. |
setCreationTime(Date value)
public void setCreationTime(Date value)
Sets the creation time.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.util.Date | DateTime’s value. |
setDisplayName(String value)
public void setDisplayName(String value)
Sets the display name.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | DateTime’s value. |