OfficeIMO.Visio 3.2.0

Prefix Reserved
dotnet add package OfficeIMO.Visio --version 3.2.0
                    
NuGet\Install-Package OfficeIMO.Visio -Version 3.2.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.Visio" Version="3.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OfficeIMO.Visio" Version="3.2.0" />
                    
Directory.Packages.props
<PackageReference Include="OfficeIMO.Visio" />
                    
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.Visio --version 3.2.0
                    
#r "nuget: OfficeIMO.Visio, 3.2.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.Visio@3.2.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.Visio&version=3.2.0
                    
Install as a Cake Addin
#tool nuget:?package=OfficeIMO.Visio&version=3.2.0
                    
Install as a Cake Tool

OfficeIMO.Visio - Visio diagrams for .NET

nuget version nuget downloads

OfficeIMO.Visio creates, edits, inspects, validates, and exports .vsdx, .vstx, .vssx, .vsdm, .vstm, and .vssm packages without COM automation and without Microsoft Visio installed.

If OfficeIMO saves you time, please consider supporting the work through GitHub Sponsors or PayPal. PowerShell users should use PSWriteOffice for the PowerShell-facing experience.

Install

dotnet add package OfficeIMO.Visio

Quick start

using OfficeIMO.Visio;
using OfficeIMO.Visio.Fluent;

var document = VisioDocument.Create("diagram.vsdx");
document.AsFluent()
    .Info(info => info.Title("Demo").Author("OfficeIMO"))
    .Page("Page-1", page => page
        .Title("Demo Flow")
        .Rect("start", 1, 1, 2, 1, "Start")
        .Diamond("decision", 4, 1.5, 2, 2, "Decision")
        .Ellipse("end", 7, 1.5, 2, 1, "End")
        .Connect("start", "decision", VisioSide.Right, VisioSide.Left,
            connector => connector.RightAngle().ArrowEnd(EndArrow.Triangle))
        .Connect("decision", "end", VisioSide.Right, VisioSide.Left,
            connector => connector.RightAngle().ArrowEnd(EndArrow.Triangle).Label("Yes")))
    .End();
document.Save();

What it does

  • Creates and edits Visio pages, shapes, connectors, text, styles, Shape Data, layers, hyperlinks, containers, comments, and metadata.
  • Provides fluent diagram builders for common flowchart, block, dependency, architecture, network, topology, swimlane, org chart, sequence, timeline, and generic graph scenarios.
  • Supports loaded-diagram editing, shape selection, topology queries, stencil replacement/migration planning, and container maintenance.
  • Edits nested container topology, swimlane metadata and geometric assignment, threaded comments and authors, generated data graphics and legends, and source-preserving ShapeSheet sections and formulas.
  • Provides rotation- and connector-aware resize-to-content plus deterministic topology-aware whole-page relayout for dense imported diagrams.
  • Preserves opaque VBA project payloads in macro-enabled drawing, template, and stencil packages without executing or rewriting VBA.
  • Exports headless PNG, JPEG, TIFF, SVG, and lossless WebP previews for proof and review workflows.
  • Includes validation and quality analysis for generated and loaded diagrams, including connector-label collisions with unrelated connector paths.
  • Carries caller-supplied stencil license, attribution, and unsupported-master state through shapes, catalogs, and manifests without inferring redistribution rights.

Editing existing diagrams

Load materializes an editable diagram. File and stream entry points accept the same VisioLoadOptions. New asynchronous calls should use the options-first shape; token-first overloads remain available for source and binary compatibility.

using OfficeIMO.Drawing;
using OfficeIMO.Visio;
using OfficeIMO.Visio.Fluent;
using Color = OfficeIMO.Drawing.OfficeColor;

VisioDocument.Load("operations.vsdx")
    .AsFluent()
    .ExistingPage("Operations", page => page
        .ShapesWithData("Owner", "Ops", selection => selection
            .Fill(Color.LightBlue)
            .ShapeData("Reviewed", "Yes", "Reviewed", VisioShapeDataType.Boolean))
        .ShapesContainingText("Legacy", selection => selection
            .Text(shape => shape.Text!.Replace("Legacy", "Production", StringComparison.Ordinal))))
    .End()
    .Save("operations.updated.vsdx");

Loaded-diagram compatibility boundary

Loaded Open XML Visio editing covers pages, shapes, connectors, text, styles, Shape Data, hyperlinks, layers, nested containers, swimlanes, threaded comments, data graphics, legends, typed ShapeSheet sections/formulas, topology queries, resize-to-content, and whole-diagram relayout. Template and stencil packages use the same model, including page-less stencils with masters. Macro-enabled variants retain their VBA project as an opaque bounded payload.

The boundary is deliberate: OfficeIMO does not execute VBA, evaluate arbitrary ShapeSheet formulas, or claim native Visio layout equivalence. Typed edits retain unmodeled ShapeSheet rows, cells, attributes, and supported opaque payloads in their existing preservation stores. Arbitrary producer package parts outside those stores are not advertised as editable. Ambiguous swimlane geometry is reported instead of assigned, container cycles are rejected, and semantic relayout keeps containers and generated adornments fixed unless the caller opts in.

Signed diagrams

InspectSignatures() detects Open XML signature-origin relationships and XML signature parts. Saving a loaded signed diagram is blocked by default because rebuilding the package would invalidate that evidence. Set SignatureMutationPolicy = VisioSignatureMutationPolicy.RemoveInvalidatedSignatures only when removing the stale signature carrier is the intended result. SignPackageSignature(...) and ValidatePackageSignatures(...) create and cryptographically validate OPC signatures through an explicitly supplied IOfficeSecurityProvider.

Examples

The quick start shows the fluent page API. These examples show the higher-level builders and editing surfaces that belong in OfficeIMO.Visio.

Flowchart builder

using OfficeIMO.Visio;
using OfficeIMO.Visio.Diagrams;

VisioDocument.Create("flowchart.vsdx")
    .Flowchart("Property buying flowchart", flow => flow
        .Title()
        .Layout(VisioFlowchartLayout.TwoColumnContinuation)
        .RouteBranches(laneSpacing: 0.5)
        .Start("start", "Start with an agent\nyou trust")
        .Step("consult", "Consult with agent to\ndetermine needs")
        .Decision("agreement", "Agreement?")
        .Step("contract", "Accept the contract")
        .End("close", "Close on the property")
        .Branch("agreement", "No", "consult")
        .Branch("agreement", "Yes", "contract")
        .Callout("agreement", "retry-note", "Loop back if rejected", VisioSide.Right))
    .Save();

Network topology builder

using OfficeIMO.Visio;
using OfficeIMO.Visio.Diagrams;

VisioDocument.Create("network-topology.vsdx")
    .NetworkTopologyDiagram("Branch topology", topology => topology
        .Title()
        .Root("internet", "Internet", VisioNetworkNodeKind.Internet)
        .Firewall("firewall", "Firewall")
        .Switch("core", "Core Switch")
        .Server("app", "App Server")
        .Database("db", "Database")
        .Workstation("finance", "Finance PC")
        .Subnet("edge", "Edge", "internet", "firewall", "core")
        .Subnet("servers", "Server Zone", "app", "db")
        .Ethernet("internet", "firewall", "WAN")
        .Trunk("firewall", "core", "uplink")
        .Trunk("core", "app", "10Gb")
        .Ethernet("app", "db"))
    .Save();

Sequence diagram builder

using OfficeIMO.Visio;
using OfficeIMO.Visio.Diagrams;

VisioDocument.Create("sequence.vsdx")
    .SequenceDiagram("Checkout sequence", sequence => sequence
        .Title()
        .Theme(VisioStyleTheme.Fluent())
        .Actor("customer", "Customer")
        .Participant("web", "Web App")
        .Control("api", "Orders API")
        .Database("db", "Orders DB")
        .Call("customer", "web", "Checkout")
        .Call("web", "api", "POST /orders")
        .Async("api", "db", "Persist order")
        .Return("api", "web", "201 Created")
        .SelfMessage("web", "Render receipt"))
    .Save();

Timeline roadmap

using OfficeIMO.Visio;
using OfficeIMO.Visio.Diagrams;

VisioDocument.Create("roadmap.vsdx")
    .TimelineDiagram("Product roadmap", timeline => timeline
        .Title()
        .Theme(VisioStyleTheme.Modern())
        .Range(new DateTime(2026, 1, 1), new DateTime(2026, 6, 30))
        .Span("discovery", new DateTime(2026, 1, 8), new DateTime(2026, 2, 20), "Discovery")
        .Span("build", new DateTime(2026, 2, 21), new DateTime(2026, 5, 15), "Build", lane: 1)
        .Release("preview", new DateTime(2026, 5, 20), "Public preview", VisioTimelinePlacement.Below)
        .Milestone("ga", new DateTime(2026, 6, 25), "GA"))
    .Save();

Layers and Shape Data

using OfficeIMO.Visio;
using OfficeIMO.Visio.Stencils;
using Color = OfficeIMO.Drawing.OfficeColor;

var document = VisioDocument.Create("architecture.vsdx");
var page = document.AddPage("Architecture");
page.AddLayer("Infrastructure");
page.AddLayer("Annotations").Print = false;

var server = page.AddStencilShape(VisioStencils.Network.Get("server"),
    "server", 2, 5, "Server");
server.SetShapeData("Owner", "Platform", "Owner",
    VisioShapeDataType.String, "Owning support team");

page.AddToLayer("Infrastructure", server);
page.SelectWithShapeData("Owner", "Platform")
    .Fill(Color.LightBlue)
    .ShapeData("Reviewed", "Yes", "Reviewed",
        VisioShapeDataType.Boolean, "Architecture review complete");

document.Save();

When a catalog comes from an external package, make its provenance explicit:

var options = new VisioStencilPackageLoadOptions {
    SourceLicense = "License identifier or notice supplied by the caller",
    SourceAttribution = "Required source attribution",
    IncludeUnsupportedMasters = true
};

Unsupported masters remain marked as unsupported even when included for inventory or migration planning. Including them does not turn them into a fully supported authoring contract or grant redistribution rights.

Headless image export

using OfficeIMO.Visio;

var document = VisioDocument.Create("pipeline.vsdx");
var page = document.AddPage("Pipeline").Size(8, 4);
var build = page.AddProcess(1.5, 2, 1.4, 0.7, "Build");
var ship = page.AddProcess(5.5, 2, 1.4, 0.7, "Ship");
page.AddConnector(build, ship, ConnectorKind.RightAngle, VisioSide.Right, VisioSide.Left)
    .EndArrow = EndArrow.Arrow;

document.SaveAsSvg("pipeline.svg", new VisioSvgSaveOptions {
    PixelsPerInch = 96,
    BackgroundColor = null
});

document.SaveAsPng("pipeline.png", new VisioPngSaveOptions {
    PixelsPerInch = 144,
    Supersampling = 3
});

OfficeImageExportResult webp = document
    .ToImage()
    .AtDpi(144)
    .AsWebp()
    .Save("pipeline.webp");

IReadOnlyList<OfficeImageExportResult> pages = document
    .ToImages()
    .AllPages()
    .AsJpeg()
    .Save("pipeline-pages");
  • OfficeIMO.Visio generates and edits drawing, template, stencil, and macro-enabled Open XML Visio packages without requiring desktop Visio at runtime.
  • ToOfficeDocumentModel(...) projects Visio content into the dependency-free model in OfficeIMO.Core; direct converters can consume it without taking Reader dependencies.
  • External stencil packages retain their package and licensing requirements; OfficeIMO records caller-supplied provenance but never infers licensing terms.
  • Use PSWriteOffice for PowerShell workflows.
  • Open Visio product work is listed in the repository roadmap.

Deeper docs

Targets and license

  • Targets: netstandard2.0, net8.0, net10.0; net472 is included when building on Windows.
  • License: MIT.
  • Repository: EvotecIT/OfficeIMO

Dependency footprint

  • External: System.IO.Packaging; Microsoft BCL compatibility packages are used on older targets.
  • OfficeIMO: OfficeIMO.Core. The VSDX model, builders, editing, topology, validation, and PNG/JPEG/TIFF/SVG/WebP renderers are first-party.
  • Security: Open XML signature carriers are inspected and signed-diagram mutations fail safely without a cryptographic dependency. Signature creation and validation accept an explicit IOfficeSecurityProvider; OfficeIMO.Security is not pulled transitively.

See the complete OfficeIMO package map for related formats and conversion paths.

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 (2)

Showing the top 2 NuGet packages that depend on OfficeIMO.Visio:

Package Downloads
OfficeIMO.Reader.Visio

Visio adapter for OfficeIMO.Reader using OfficeIMO.Visio inspection snapshots.

OfficeIMO.Visio.Pdf

First-party loss-aware Visio to PDF conversion for OfficeIMO.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.2.0 57 8/7/2026
3.1.1 67 8/7/2026
3.1.0 51 8/6/2026
3.0.3 227 7/27/2026
3.0.2 185 7/26/2026
3.0.1 440 7/26/2026
3.0.0 532 7/20/2026
2.0.1 321 7/14/2026
2.0.0 148 7/14/2026
1.0.15 275 7/9/2026
1.0.14 317 7/8/2026
1.0.13 513 7/5/2026
1.0.12 261 7/4/2026
1.0.11 296 6/27/2026
1.0.10 173 6/27/2026
1.0.9 437 6/24/2026
1.0.8 209 6/23/2026
1.0.7 328 6/21/2026
1.0.6 169 6/16/2026
1.0.5 377 6/16/2026
Loading failed