OfficeIMO.OneNote.Pdf 3.0.0

Prefix Reserved
dotnet add package OfficeIMO.OneNote.Pdf --version 3.0.0
                    
NuGet\Install-Package OfficeIMO.OneNote.Pdf -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OfficeIMO.OneNote.Pdf" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OfficeIMO.OneNote.Pdf" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="OfficeIMO.OneNote.Pdf" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OfficeIMO.OneNote.Pdf --version 3.0.0
                    
#r "nuget: OfficeIMO.OneNote.Pdf, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OfficeIMO.OneNote.Pdf@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OfficeIMO.OneNote.Pdf&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=OfficeIMO.OneNote.Pdf&version=3.0.0
                    
Install as a Cake Tool

OfficeIMO.OneNote.Pdf

OfficeIMO.OneNote.Pdf converts the typed offline OneNote model to PDF without Microsoft Graph, a OneNote installation, or a commercial dependency. It provides a semantic document path and a position-preserving page path.

Semantic PDF

The semantic path projects OneNote through OfficeIMO.OneNote.Markdown, then uses the first-party OfficeIMO.Markdown.Pdf and OfficeIMO.Pdf engines. It favors selectable text and normal document reflow:

using OfficeIMO.OneNote;
using OfficeIMO.OneNote.Pdf;

OneNoteSection section = OneNoteSectionReader.Read("Section.one");
byte[] pdf = section.ToPdf();
section.SaveAsPdf("Section.pdf");

OneNote pages are free-form canvases. The current SemanticDocument mode intentionally flattens them into reading order. ToPdfDocumentResult() reports canvas flattening, formatting simplification, unresolved asset placeholders, link-only binary assets, opaque omissions, and source diagnostics. It does not claim pixel parity with the OneNote desktop canvas.

Use OneNotePdfSaveOptions.ProjectionOptions for conflict/version inclusion and asset destinations, and OneNotePdfSaveOptions.PdfOptions for PDF layout, fonts, image policy, and diagnostics.

OneNote PDF export adds multilingual fallback candidates in addition to the normal document, monospace, and symbol candidates. The balanced default uses installed fonts while denying arbitrary local and remote reads; portable deterministic mode is explicit. Conversion clones both projection and PDF options so reusable caller configuration is not mutated:

using OfficeIMO.Markdown.Pdf;
using OfficeIMO.Pdf;

var options = new OneNotePdfSaveOptions {
    PdfOptions = new MarkdownPdfSaveOptions {
        ResourcePolicy = PdfResourcePolicy.CreateTrustedHost()
    }
};

PdfDocumentConversionResult result = section.ToPdfDocumentResult(options);
foreach (PdfConversionWarning warning in result.Warnings) {
    Console.WriteLine($"{warning.Code}: {warning.Message}");
}
result.Save("Section.pdf");

Invalid Unicode noncharacters and native control codes are normalized by OfficeIMO.OneNote.Markdown before layout. Valid characters that remain uncovered by the configured fonts still produce the normal PDF conversion diagnostic rather than being silently discarded.

Visual page PDF

The visual path uses the same positioned OfficeDrawing canvas as PNG/JPEG/TIFF/SVG/WebP and visual HTML export. Each page is rasterized once and placed edge-to-edge at the canvas's page geometry, retaining freeform placement, images and printouts, ink, structured math, and attachment placeholders.

var visualOptions = new OneNoteVisualPdfOptions {
    RasterScale = 2, // 144 DPI
    MaximumRasterPixels = 50_000_000,
    PageRendering = new OneNotePageRenderingOptions {
        // Optional: decoder for additional embedded source image formats.
        ImageCodec = applicationImageCodec
    },
    Title = "Project notebook"
};

byte[] visualPdf = section.ToVisualPdf(visualOptions);
var result = section.SaveAsVisualPdf("Section-visual.pdf", visualOptions);
foreach (var warning in result.Report.Warnings) {
    Console.WriteLine($"{warning.Code}: {warning.Message}");
}

RasterScale defaults to 2. If a page would exceed MaximumRasterPixels, the Drawing-owned limiter reduces its scale and reports ONENOTE_PDF_RASTER_SCALE_LIMITED. Embedded pictures that neither Drawing nor PageRendering.ImageCodec can decode are replaced visibly and reported as DRAWING_RASTER_IMAGE_UNSUPPORTED. Visual PDF is image-backed and does not provide selectable page text; use semantic PDF when search, selection, or reflow is more important than the original canvas layout.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 82 7/20/2026