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

ConstructorDescription
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

MethodDescription
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:

ParameterTypeDescription
filePathjava.lang.StringThe 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:

ParameterTypeDescription
filePathjava.lang.StringThe file path.
loadOptionsLoadOptionsOptions 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:

ParameterTypeDescription
inStreamjava.io.InputStreamThe 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:

ParameterTypeDescription
inStreamjava.io.InputStreamThe stream.
loadOptionsLoadOptionsOptions used to load a document. Can be null.

accept(DocumentVisitor visitor)

public void accept(DocumentVisitor visitor)

Accepts the visitor of the node.

Parameters:

ParameterTypeDescription
visitorDocumentVisitorThe 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:

ParameterTypeDescription
pagePageThe 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:

ParameterTypeDescription
streamjava.io.InputStreamThe stream.
documentDocument[]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:

ParameterTypeDescription
streamjava.io.InputStreamThe stream.
optionsLoadOptionsThe load options.
documentDocument[]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:

ParameterTypeDescription
streamjava.io.InputStreamThe stream.
passwordjava.lang.StringThe password to decrypt a document.
documentDocument[]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:

ParameterTypeDescription
filePathjava.lang.StringThe file path.
documentDocument[]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:

ParameterTypeDescription
filePathjava.lang.StringThe file path.
optionsLoadOptionsThe load options.
documentDocument[]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:

ParameterTypeDescription
filePathjava.lang.StringThe file path.
passwordjava.lang.StringThe password to decrypt a document.
documentDocument[]The loaded document.

Returns: boolean - Returns true if the document is encrypted otherwise false.

public void print()

Prints the document using the default printer.

public void print(PrintOptions options)

Prints the document using the default printer.

Parameters:

ParameterTypeDescription
optionsPrintOptionsOptions used to print a document. Can be null.
public void print(String printerName)

Prints the document using the default printer.

Parameters:

ParameterTypeDescription
printerNamejava.lang.String
public void print(AttributeSet printSettings)

Prints the document using the default printer.

Parameters:

ParameterTypeDescription
printSettingsjavax.print.attribute.AttributeSet

save(OutputStream stream)

public void save(OutputStream stream)

Saves the OneNote document to a stream.

Parameters:

ParameterTypeDescription
streamjava.io.OutputStreamThe 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:

ParameterTypeDescription
streamjava.io.OutputStreamThe System.iO.stream where the document will be saved.
optionsSaveOptionsSpecifies 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:

ParameterTypeDescription
streamjava.io.OutputStreamThe System.iO.stream where the document will be saved.
formatintThe format in which to save the document.

save(String fileName)

public void save(String fileName)

Saves the OneNote document to a file.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringThe 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:

ParameterTypeDescription
fileNamejava.lang.StringThe full name for the file. If a file with the specified full name already exists, the existing file is overwritten.
optionsSaveOptionsSpecifies 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:

ParameterTypeDescription
fileNamejava.lang.StringThe full name for the file. If a file with the specified full name already exists, the existing file is overwritten.
formatintThe 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:

ParameterTypeDescription
valuebooleanNew value. Can be null.

setColor(Color value)

public void setColor(Color value)

Sets the color.

Parameters:

ParameterTypeDescription
valuejava.awt.ColorColor’s value.

setCreationTime(Date value)

public void setCreationTime(Date value)

Sets the creation time.

Parameters:

ParameterTypeDescription
valuejava.util.DateDateTime’s value.

setDisplayName(String value)

public void setDisplayName(String value)

Sets the display name.

Parameters:

ParameterTypeDescription
valuejava.lang.StringDateTime’s value.