Pkg.OneNote — API for parsing Microsoft OneNote documents

Overview

The Pkg.OneNote module contains the API for parsing Microsoft OneNote documents.

Enumerating Files in a OneNote Document

The following code example demonstrates how to enumerate embedded files in a OneNote document:

from Pro.Core import *
from Pkg.OneNote import *

def parseOneNoteDocument(fname):
    c = createContainerFromFile(fname)
    if c.isNull():
        return
    obj = OneNoteObject()
    if not obj.Load(c):
        return
    files = obj.GetEmbeddedFiles()
    for file in files:
        print(file)

Module API

Pkg.OneNote module API.

Classes:

OneNoteObject()

This class represents a OneNote document.

class OneNoteObject

Bases: Pro.Core.CFFObject

This class represents a OneNote document.

Methods:

GetEmbeddedFiles([wo])

Retrieves the list of embedded files.

GetHeader()

Returns the header of the document.

GetProperties()

Returns the properties of the document.

OutputFilesInfo(out)

Outputs to a text stream information about the embedded files.

OutputProperties(out)

Outputs to a text stream the properties of the document.

Parse([wo])

Parses the document.

GetEmbeddedFiles(wo: Optional[Pro.Core.NTIWait] = None)List[Tuple[int, int, str, str]]

Retrieves the list of embedded files.

Parameters

wo (NTIWait) – An optional wait object.

Returns

Returns a list of tuples. Each tuple contains embedded file offset, size, extension and identity.

Return type

List[Tuple[int, int, str, str]]

See also OutputFilesInfo().

GetHeader()Pro.Core.CFFStruct
Returns

Returns the header of the document.

Return type

CFFStruct

GetProperties()Dict[str, Any]
Returns

Returns the properties of the document.

Return type

Dict[str, Any]

See also OutputProperties().

OutputFilesInfo(out: Pro.Core.NTTextStream)None

Outputs to a text stream information about the embedded files.

Parameters

out (NTTextStream) – The output stream.

See also OutputProperties().

OutputProperties(out: Pro.Core.NTTextStream)None

Outputs to a text stream the properties of the document.

Parameters

out (NTTextStream) – The output stream.

See also GetProperties() and OutputFilesInfo().

Parse(wo: Optional[Pro.Core.NTIWait] = None)bool

Parses the document.

Parameters

wo (NTIWait) – An optional wait object for the parsing operation.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also GetEmbeddedFiles().