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
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(InputStream stream, Document[] document) Checks whether a document from a stream is encrypted.
isEncrypted(String filePath, LoadOptions options, Document[] document) Checks whether a document from a file is encrypted.
isEncrypted(String filePath, 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.
getAutomaticLayoutChangesDetectionEnabled() Gets a value indicating whether Aspose.Note performs detection of layout changes automatically.
setAutomaticLayoutChangesDetectionEnabled(boolean value) Sets a value indicating whether Aspose.Note performs detection of layout changes automatically.
getCreationTime() Gets the creation time.
setCreationTime(Date value) Sets the creation time.
getColor() Gets the color.
setColor(Color value) Sets the color.
getDisplayName() Gets the display name.
setDisplayName(String value) Sets the display name.
getGuid() Gets the object’s globally unique id.
getGuidInternal()
getFileFormat() Gets file format (OneNote 2010, OneNote Online).
accept(DocumentVisitor visitor) Accepts the visitor of the node.
getPageHistory(Page page) Gets the PageHistory which contains full history for each page presented in a document (the earliest at index 0).
save(String fileName) Saves the OneNote document to a file.
save(OutputStream stream) Saves the OneNote document to a stream.
save(String fileName, int format) Saves the OneNote document to a file in the specified format.
save(OutputStream stream, int format) Saves the OneNote document to a stream in the specified format.
save(String fileName, SaveOptions options) Saves the OneNote document to a file using the specified save options.
save(OutputStream stream, SaveOptions options) Saves the OneNote document to a stream using the specified save options.
print() 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.
print(PrintOptions options) Prints the document using the default printer.
detectLayoutChanges() Detects all changes made to the document layout since the previous DetectLayoutChanges call.

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.

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(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(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, 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, 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.

getAutomaticLayoutChangesDetectionEnabled()

public boolean getAutomaticLayoutChangesDetectionEnabled()

Gets a value indicating whether Aspose.Note performs detection of layout changes automatically. Default value is true .

Returns: boolean

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.

getCreationTime()

public Date getCreationTime()

Gets the creation time.

Returns: java.util.Date

setCreationTime(Date value)

public void setCreationTime(Date value)

Sets the creation time.

Parameters:

Parameter Type Description
value java.util.Date DateTime’s value.

getColor()

public Color getColor()

Gets the color.

Returns: java.awt.Color

setColor(Color value)

public void setColor(Color value)

Sets the color.

Parameters:

Parameter Type Description
value java.awt.Color Color’s value.

getDisplayName()

public String getDisplayName()

Gets the display name.

Returns: java.lang.String

setDisplayName(String value)

public void setDisplayName(String value)

Sets the display name.

Parameters:

Parameter Type Description
value java.lang.String DateTime’s value.

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

getFileFormat()

public int getFileFormat()

Gets file format (OneNote 2010, OneNote Online).

Returns: int

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 .

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 .

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(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(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.

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, 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(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.
public void print()

Prints the document using the default printer.

public void print(String printerName)

Prints the document using the default printer.

Parameters:

Parameter Type Description
printerName java.lang.String
public void print(AttributeSet printSettings)

Prints the document using the default printer.

Parameters:

Parameter Type Description
printSettings javax.print.attribute.AttributeSet
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.

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.