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

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.

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

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:

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

ParameterTypeDescription
valuejava.util.DateDateTime’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:

ParameterTypeDescription
valuejava.awt.ColorColor’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:

ParameterTypeDescription
valuejava.lang.StringDateTime’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:

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

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

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

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

Prints the document using the default printer.

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
public void print(PrintOptions options)

Prints the document using the default printer.

Parameters:

ParameterTypeDescription
optionsPrintOptionsOptions 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.