com.aspose.note

Class Notebook

    • Constructor Detail

      • Notebook

        public Notebook()

        Initializes a new instance of the Notebook class.

      • Notebook

        public Notebook(String filePath)

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

        Parameters:
        filePath - The file path.
      • Notebook

        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:
        filePath - The file path.
        loadOptions - The load options.
      • Notebook

        public Notebook(InputStream stream)

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

        Parameters:
        stream - The stream.
      • Notebook

        public Notebook(InputStream stream,
                        NotebookLoadOptions loadOptions)

        Initializes a new instance of the Notebook class. Opens an existing OneNote notebook from a stream. Allows to specify additional loading options.

        Parameters:
        stream - The stream.
        loadOptions - The load options.
    • Method Detail

      • isHistoryEnabled

        public boolean isHistoryEnabled()

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

      • setHistoryEnabled

        public void setHistoryEnabled(boolean value)

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

      • setColor

        public void setColor(Color value)

        Gets or sets the color.

      • setDisplayName

        public void setDisplayName(String value)

        Gets or sets the display name.

      • getCount

        public int getCount()

        Gets the number of elements contained in the Notebook.

      • getFileFormat

        public int getFileFormat()

        Gets file format (OneNote 2010, OneNote Online).

      • get_Item

        public INotebookChildNode get_Item(int index)

        Gets notebook child node by the given index.

        Parameters:
        index - Index to child node.
        Returns:
        The child node on the index position.
      • iterator

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

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

        Specified by:
        iterator in interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable<INotebookChildNode>
        Specified by:
        iterator in interface com.aspose.ms.System.Collections.IEnumerable<INotebookChildNode>
        Specified by:
        iterator in interface Iterable<INotebookChildNode>
        Returns:
        A IEnumerator.
      • getChildNodes

        public <T1 extends NodeList<T1> getChildNodes(Class<T1> typeParameterClass)

        Get all child nodes by the node type.

        Returns:
        A list of child nodes.

        T1: The type of elements in the returned list.

      • appendChild

        public INotebookChildNode appendChild(INotebookChildNode newChild)

        Adds the node to the end of the list.

        Parameters:
        newChild - The node to add.
        Returns:
        The added node.
      • loadChildDocument

        public void loadChildDocument(String filePath)

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

        Parameters:
        filePath - The file path.
      • loadChildDocument

        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:
        filePath - The file path.
        loadOptions - The load options.
      • loadChildDocument

        public void loadChildDocument(InputStream stream)

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

        Parameters:
        stream - The stream.
      • loadChildDocument

        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:
        stream - The stream.
        loadOptions - The load options.
      • loadChildNotebook

        public void loadChildNotebook(String filePath)

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

        Parameters:
        filePath - The file path.
      • loadChildNotebook

        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:
        filePath - The file path.
        loadOptions - The load options.
      • loadChildNotebook

        public void loadChildNotebook(InputStream stream)

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

        Parameters:
        stream - The stream.
      • loadChildNotebook

        public void loadChildNotebook(InputStream stream,
                                      NotebookLoadOptions loadOptions)

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

        Parameters:
        stream - The stream.
        loadOptions - The load options.
      • save

        public void save(String fileName)
                  throws IOException

        Saves the OneNote document to a file.

        Parameters:
        fileName - The full name for the file. If a file with the specified full name already exists, the existing file is overwritten.
        Throws:
        com.aspose.note.infrastructure.IncorrectDocumentStructureException - The document structure violates specification.
        com.aspose.note.infrastructure.UnsupportedSaveFormatException - Requested save format is not supported.
        IOException
      • save

        public void save(OutputStream stream)
                  throws IOException

        Saves the OneNote document to a stream.

        Parameters:
        stream - The stream.
        Throws:
        com.aspose.note.infrastructure.IncorrectDocumentStructureException - The document structure violates specification.
        com.aspose.note.infrastructure.UnsupportedSaveFormatException - Requested save format is not supported.
        IOException
      • save

        public void save(String fileName,
                         int format)
                  throws IOException

        Saves the OneNote document to a file in the specified format.

        Parameters:
        fileName - The full name for the file. If a file with the specified full name already exists, the existing file is overwritten.
        format - The format in which to save the document.
        Throws:
        com.aspose.note.infrastructure.IncorrectDocumentStructureException - The document structure violates specification.
        com.aspose.note.infrastructure.UnsupportedSaveFormatException - Requested save format is not supported.
        IOException
      • save

        public void save(OutputStream stream,
                         int format)
                  throws IOException

        Saves the OneNote document to a stream in the specified format.

        Parameters:
        stream - The stream.
        format - The format in which to save the document.
        Throws:
        com.aspose.note.infrastructure.IncorrectDocumentStructureException - The document structure violates specification.
        com.aspose.note.infrastructure.UnsupportedSaveFormatException - Requested save format is not supported.
        IOException
      • save

        public void save(String fileName,
                         NotebookSaveOptions options)
                  throws IOException

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

        Parameters:
        fileName - The full name for the file. If a file with the specified full name already exists, the existing file is overwritten.
        options - Specifies the options how the document is saved in file.
        Throws:
        com.aspose.note.infrastructure.IncorrectDocumentStructureException - The document structure violates specification.
        com.aspose.note.infrastructure.UnsupportedSaveFormatException - Requested save format is not supported.
        IOException
      • save

        public void save(OutputStream stream,
                         NotebookSaveOptions options)
                  throws IOException

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

        Parameters:
        stream - The stream.
        options - Specifies the options how the document is saved.
        Throws:
        com.aspose.note.infrastructure.IncorrectDocumentStructureException - The document structure violates specification.
        com.aspose.note.infrastructure.UnsupportedSaveFormatException - Requested save format is not supported.
        IOException