# OneNoteNotebookReader

Reads a local OneNote notebook hierarchy from .onetoc2 files and sibling sections.

Class 

`OfficeIMO.OneNote`

**Namespace**

`OfficeIMO.OneNote`

**Assembly**

`OfficeIMO.OneNote`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[OneNoteNotebookReader.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Reading/OneNoteNotebookReader.cs#L13)

**Modifiers**

static

Reads a local OneNote notebook hierarchy from .onetoc2 files and sibling sections.

## Inheritance

- object
- OneNoteNotebookReader

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Read and Write OneNote Notebooks](/docs/onenote/notebooks/) Guide
  
  Open OneNote notebooks from a folder, a .onetoc2 file or a .onepkg export, walk section groups and sections, and write notebooks offline.
- [Convert OneNote to PDF, HTML, Markdown and Images](/docs/onenote/export-and-convert/) Guide
  
  Convert OneNote sections and notebooks to PDF, HTML or Markdown, render pages to PNG, TIFF or SVG images, and extract chunks for search, all offline.

Filter members 

Show inherited

## Methods

Read 2 overloads

`public static OneNoteNotebook Read(string tableOfContentsPath, OneNoteNotebookReaderOptions? options = null)` [#](#method-read-string-officeimo-onenote-onenotenotebookreaderoptions)

[OneNoteNotebookReader.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Reading/OneNoteNotebookReader.cs#L13)

Reads a notebook from a local .onetoc2 file or a directory containing a root TOC.

Parameters

**tableOfContentsPath string required**

**options OfficeIMO.OneNote.OneNoteNotebookReaderOptions? = null optional**

Returns

`OneNoteNotebook`

`public static OneNoteNotebook Read(Stream tableOfContentsStream, string sourceName = "Open Notebook.onetoc2", OneNoteNotebookReaderOptions? options = null)` [#](#method-read-io-stream-string-officeimo-onenote-onenotenotebookreaderoptions)

[OneNoteNotebookReader.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Reading/OneNoteNotebookReader.cs#L46)

Reads the root hierarchy from a caller-owned .onetoc2 stream. Because a standalone stream cannot resolve sibling files, returned sections and groups contain TOC metadata only.

Parameters

**tableOfContentsStream System.IO.Stream required**

**sourceName string = "Open Notebook.onetoc2" optional**

**options OfficeIMO.OneNote.OneNoteNotebookReaderOptions? = null optional**

Returns

`OneNoteNotebook`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:8D538944FD5D3ABBC88D1F9A0E83F6ACCAD3DB7B0EE546D84E2CB3DCCA0C7178 -->
