Notebook

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.note.INotebookChildNode, com.aspose.ms.System.Collections.Generic.IGenericEnumerable

public class Notebook implements INotebookChildNode, System.Collections.Generic.IGenericEnumerable<INotebookChildNode>

Represents an Aspose.Note notebook.

Constructors

ConstructorDescription
Notebook()Initializes a new instance of the Notebook class.
Notebook(String filePath)Initializes a new instance of the Notebook class.
Notebook(String filePath, NotebookLoadOptions loadOptions)Initializes a new instance of the Notebook class.

Methods

MethodDescription
isHistoryEnabled()Gets or sets a value indicating whether the history is enabled.
setHistoryEnabled(boolean value)Gets or sets a value indicating whether the history is enabled.
getColor()Gets or sets the color.
setColor(Color value)Gets or sets the color.
getDisplayName()Gets or sets the display name.
setDisplayName(String value)Gets or sets the display name.
getGuid()Gets the object’s globally unique id.
getGuidInternal()
getCount()Gets the number of elements contained in the Notebook .
getFileFormat()Gets file format (OneNote 2010, OneNote Online).
get_Item(int index)Gets notebook child node by the given index.
iterator()Returns an enumerator that iterates through child nodes of the Notebook .
getChildNodes(Class typeParameterClass)Get all child nodes by the node type.
appendChild(INotebookChildNode newChild)Adds the node to the end of the list.
removeChild(INotebookChildNode oldChild)Removes the child node.
loadChildDocument(String filePath)Adds a child document node.
loadChildDocument(String filePath, LoadOptions loadOptions)Adds a child document node.
loadChildDocument(InputStream stream)Adds a child document node.
loadChildDocument(InputStream stream, LoadOptions loadOptions)Adds a child document node.
loadChildNotebook(String filePath)Adds a child notebook node.
loadChildNotebook(String filePath, NotebookLoadOptions loadOptions)Adds a child notebook node.
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, NotebookSaveOptions options)Saves the OneNote document to a file using the specified save options.
save(OutputStream stream, NotebookSaveOptions options)Saves the OneNote document to a stream using the specified save options.

Notebook()

public Notebook()

Initializes a new instance of the Notebook class.

Notebook(String filePath)

public Notebook(String filePath)

Initializes a new instance of the Notebook class. Opens an existing OneNote notebook from a file.

Parameters:

ParameterTypeDescription
filePathjava.lang.StringThe file path.

Notebook(String filePath, NotebookLoadOptions loadOptions)

public Notebook(String filePath, NotebookLoadOptions loadOptions)

Initializes a new instance of the Notebook class. Opens an existing OneNote notebook from a file. Allows to specify additional options such as a children loading strategy (“lazy”/instant).

Parameters:

ParameterTypeDescription
filePathjava.lang.StringThe file path.
loadOptionsNotebookLoadOptionsThe load options.

isHistoryEnabled()

public boolean isHistoryEnabled()

Gets or sets a value indicating whether the history is enabled.

Returns: boolean

setHistoryEnabled(boolean value)

public void setHistoryEnabled(boolean value)

Gets or sets a value indicating whether the history is enabled.

Parameters:

ParameterTypeDescription
valueboolean

getColor()

public Color getColor()

Gets or sets the color.

Returns: java.awt.Color

setColor(Color value)

public void setColor(Color value)

Gets or sets the color.

Parameters:

ParameterTypeDescription
valuejava.awt.Color

getDisplayName()

public String getDisplayName()

Gets or sets the display name.

Returns: java.lang.String

setDisplayName(String value)

public void setDisplayName(String value)

Gets or sets the display name.

Parameters:

ParameterTypeDescription
valuejava.lang.String

getGuid()

public UUID getGuid()

Gets the object’s globally unique id.

Value: The GUID.

Returns: java.util.UUID

getGuidInternal()

public System.Guid getGuidInternal()

Returns: com.aspose.ms.System.Guid

getCount()

public int getCount()

Gets the number of elements contained in the Notebook .

Returns: int

getFileFormat()

public int getFileFormat()

Gets file format (OneNote 2010, OneNote Online).

Returns: int

get_Item(int index)

public INotebookChildNode get_Item(int index)

Gets notebook child node by the given index.

Parameters:

ParameterTypeDescription
indexintIndex to child node.

Returns: INotebookChildNode - The child node on the index position.

iterator()

public System.Collections.Generic.IGenericEnumerator<INotebookChildNode> iterator()

Returns an enumerator that iterates through child nodes of the Notebook .

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerator<com.aspose.note.INotebookChildNode> - A IEnumerator .

getChildNodes(Class typeParameterClass)

public List<T1> <T1>getChildNodes(Class<T1> typeParameterClass)

Get all child nodes by the node type.

Parameters:

ParameterTypeDescription
typeParameterClassjava.lang.Class

Returns: java.util.List - A list of child nodes.

T1 : The type of elements in the returned list.

appendChild(INotebookChildNode newChild)

public INotebookChildNode appendChild(INotebookChildNode newChild)

Adds the node to the end of the list.

Parameters:

ParameterTypeDescription
newChildINotebookChildNodeThe node to add.

Returns: INotebookChildNode - The added node.

removeChild(INotebookChildNode oldChild)

public INotebookChildNode removeChild(INotebookChildNode oldChild)

Removes the child node.

Parameters:

ParameterTypeDescription
oldChildINotebookChildNodeThe node to remove.

Returns: INotebookChildNode - The removed node.

loadChildDocument(String filePath)

public void loadChildDocument(String filePath)

Adds a child document node. Opens an existing OneNote document from a file.

Parameters:

ParameterTypeDescription
filePathjava.lang.StringThe file path.

loadChildDocument(String filePath, LoadOptions loadOptions)

public void loadChildDocument(String filePath, LoadOptions loadOptions)

Adds a child document node. Opens an existing OneNote document from a file. Allows to specify additional load options.

Parameters:

ParameterTypeDescription
filePathjava.lang.StringThe file path.
loadOptionsLoadOptionsThe load options.

loadChildDocument(InputStream stream)

public void loadChildDocument(InputStream stream)

Adds a child document node. Opens an existing OneNote document from a stream.

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamThe stream.

loadChildDocument(InputStream stream, LoadOptions loadOptions)

public void loadChildDocument(InputStream stream, LoadOptions loadOptions)

Adds a child document node. Opens an existing OneNote document from a stream. Allows to specify additional load options.

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamThe stream.
loadOptionsLoadOptionsThe load options.

loadChildNotebook(String filePath)

public void loadChildNotebook(String filePath)

Adds a child notebook node. Opens an existing OneNote notebook from a file.

Parameters:

ParameterTypeDescription
filePathjava.lang.StringThe file path.

loadChildNotebook(String filePath, NotebookLoadOptions loadOptions)

public void loadChildNotebook(String filePath, NotebookLoadOptions loadOptions)

Adds a child notebook node. Opens an existing OneNote notebook from a file. Allows to specify additional load options.

Parameters:

ParameterTypeDescription
filePathjava.lang.StringThe file path.
loadOptionsNotebookLoadOptionsThe load options.

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

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 stream.
formatintThe format in which to save the document.

save(String fileName, NotebookSaveOptions options)

public void save(String fileName, NotebookSaveOptions 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.
optionsNotebookSaveOptionsSpecifies the options how the document is saved in file.

save(OutputStream stream, NotebookSaveOptions options)

public void save(OutputStream stream, NotebookSaveOptions options)

Saves the OneNote document to a stream using the specified save options.

Parameters:

ParameterTypeDescription
streamjava.io.OutputStreamThe stream.
optionsNotebookSaveOptionsSpecifies the options how the document is saved.