DocuVerse 0.1.4
dotnet add package DocuVerse --version 0.1.4
NuGet\Install-Package DocuVerse -Version 0.1.4
<PackageReference Include="DocuVerse" Version="0.1.4" />
<PackageVersion Include="DocuVerse" Version="0.1.4" />
<PackageReference Include="DocuVerse" />
paket add DocuVerse --version 0.1.4
#r "nuget: DocuVerse, 0.1.4"
#:package DocuVerse@0.1.4
#addin nuget:?package=DocuVerse&version=0.1.4
#tool nuget:?package=DocuVerse&version=0.1.4
DocuVerse Editor for .NET
Open, render, annotate and edit PDF, Word (.docx) and Excel (.xlsx) files in .NET, on Windows, Linux and macOS (x64 and Arm64). Documents are processed where your app runs: nothing is uploaded anywhere.
dotnet add package DocuVerse
using DocuVerse;
using var doc = PdfDocument.Open("in.pdf"); // or Open(bytes, password)
Console.WriteLine($"{doc.PageCount} pages: {doc.PageText(0)}");
int id = doc.AddAnnotation(0, "{\"type\":\"Square\",\"rect\":[72,600,272,700],\"color\":\"#ff0000\"}");
doc.UpdateAnnotation(id, "{\"contents\":\"Please review\"}");
File.WriteAllBytes("page1.png", doc.RenderPagePng(0, 2.0));
doc.Save("out.pdf", incremental: true);
Edit the PDF's own text, as in a word processor: TextBlocksJson(page) lists the page's text in
blocks (paragraphs, headings, table cells) with their fonts, sizes and colours;
ReplaceText(page, block, "New text") changes a block and keeps its style; EditText(page, json)
replaces a block with styled runs, adds new text or removes a block. The text goes into the page
itself, in the PDF's own font when it has the letters, else in a real font included in the file.
The page's own pictures too: PageImagesJson(page) lists them with their place;
MoveImage(page, id, dx, dy) and TransformImage(page, id, a, b, c, d, e, f) move, resize or turn
one; ReplaceImage(page, id, png) puts another picture in its box; DeleteImage(page, id) and
AddImage(page, png, x0, y0, x1, y1) take one off or add one. Each change is one undo step.
AddTable(page, json) draws a table (column widths, row heights, borders, cell colours, styled text in
each cell; rows grow to hold their text), PageTablesJson(page) lists the tables drawn so, and
SetTable(page, id, json) / DeleteTable(page, id) change or remove one.
Word
Word documents open as pages, and WordDocument edits them:
using var word = WordDocument.Open("report.docx");
word.Command("{\"cmd\":\"insert\",\"text\":\"Hello \"}"); // JSON commands → JSON state
word.Command("{\"cmd\":\"key\",\"key\":\"Home\",\"shift\":true}");
word.Command("{\"cmd\":\"format\",\"bold\":\"toggle\"}");
File.WriteAllBytes("report-edited.docx", word.Save());
using var pages = PdfDocument.Open(word.Pdf()); // the pages as PDF
WordDocument also inserts tables ({"cmd":"insertTable","rows":3,"cols":3}) and pictures
(InsertImage(bytes, width, height)), and edits headers, footers and footnotes.
Excel
using var book = ExcelDocument.Open("sales.xlsx");
book.Command("{\"cmd\":\"select\",\"cell\":\"C2\"}");
book.Command("{\"cmd\":\"enter\",\"text\":\"220\"}"); // formulas recalculate
File.WriteAllBytes("sales-edited.xlsx", book.Save());
File.WriteAllBytes("sales.pdf", book.Pdf()); // every sheet, as printed
Fonts
Word and Excel files use their real fonts, and so do PDFs whose fonts are not included in the
file (such as Helvetica or Times). DocuVerse finds the fonts installed on the computer by
itself; Fonts.Register(bytes) adds other font files.
A ready-made editor screen (Blazor)
On .NET 10 the package also has <PdfViewer /> is a drop-in Blazor component: a complete viewer and editor for PDF, Word
(.docx) and Excel (.xlsx) files, with ribbon tabs (Edit Text, View, Annotate, Shapes, Insert, Edit,
Fill and Sign), thumbnails, comments, search, stamps, signatures and save. Edit Text changes a
PDF's own text like a Word document: click any text, type, and set its font, size, style, colour
and alignment; its pictures move, resize, turn, change or go, and new ones can be added; tables
are drawn and edited there too. It runs in the user's browser,
and you write no JavaScript.
@using DocuVerse.Blazor
@rendermode InteractiveServer
<PdfViewer @ref="viewer" Document="@pdfBytes" Author="Jane Doe" AccentColor="#5b3fd6"
HeaderButtons="@buttons" OnHeaderButton="OnButton" OnSave="Saved" />
@code {
PdfViewer? viewer;
byte[] pdfBytes = File.ReadAllBytes("contract.pdf");
PdfHeaderButton[] buttons = { new("approve", "Approve") };
async Task OnButton(string id) => await File.WriteAllBytesAsync("edited.pdf", await viewer!.SaveAsync());
Task Saved(PdfSavedEventArgs e) => File.WriteAllBytesAsync(e.FileName, e.Bytes); // Save button → your server
}
| Parameter | Meaning |
|---|---|
Document / DocumentUrl / FileName |
the document to open (bytes or URL); none = an empty viewer with an Open button |
Sample |
open the built-in sample PDF when no document is given (default false) |
Author, Theme (light/dark/auto), AccentColor, ReadOnly |
look and behaviour |
Tools, DisabledElements, InitialZoom, InitialTab, Height |
which tools and parts show; zoom (default "1.25", or "fitWidth" / "fitPage"); ribbon tab open at start; height (default 100vh) |
Layout, ScrollMode |
page layout: "single" (default), "double" (two pages side by side) or "cover" (the first page alone, then two side by side); scrolling: "continuous" (default) or "page" (one page, or pair, at a time) |
FontUrl |
where the viewer fetches fonts for Word and Excel files, and for PDFs whose fonts are not included (see below) |
HeaderButtons + OnHeaderButton |
your own header buttons, handled in C# |
OnSave |
when set, the Save button sends the bytes to C# instead of downloading |
OnEvent, OnReady |
viewer events (documentLoaded, annotationsChanged, selectionChanged, …) |
Methods: SaveAsync(incremental) → byte[], LoadAsync(bytes, fileName), LoadUrlAsync(url),
SetToolAsync(tool), SetThemeAsync(theme), SetLayoutAsync(layout), SetScrollModeAsync(mode),
AnnotationsJsonAsync(), SaveWordAsync(),
IsWordDocumentAsync().
Documents use their real fonts: Word and Excel files, and PDFs whose fonts are not included in the file (such as Helvetica or Times). Serve them to the viewer from your server, with the same package:
app.MapGet("/uds-fonts", (string? family, string? bold, string? italic, int? @char) =>
{
var bytes = family is not null ? DocuVerse.Fonts.Find(family, bold == "1", italic == "1")
: @char is int c ? DocuVerse.Fonts.ForChar(c) : null;
return bytes is null ? Results.NotFound() : Results.File(bytes, "font/ttf");
});
// <PdfViewer FontUrl="/uds-fonts" />
Licence key
Nothing opens without a DocuVerse licence key: Open, Create and Sample throw a
UdsException (its LicenseKeyNeeded is true) that says where to get one. Make a free account on
the DocuVerse website for a trial key (everything works, with a watermark), or buy a package
for a key without it. Set it once when your application starts:
DocuVerse.License.SetKey("dv1...."); // returns the status JSON
bool ok = DocuVerse.License.IsLicensed; // a package's key (a trial key: false)
The key names the licence server that made it. The SDK checks the key there when it is set and
every 12 hours, and reports the machine it runs on and how many documents it opened (counts only,
never names or content). The server turns the licence off when it was revoked, has ended or is
over its server limit (the watermark again), and gives a renewed key, which is taken by itself.
A developer's own computer (ASPNETCORE_ENVIRONMENT or DOTNET_ENVIRONMENT set to Development,
as Visual Studio and Rider do, a debugger attached, or a Mac) is reported as a development
machine: it does not take one of the licence's servers (a licence with a server limit allows 3
development machines besides).
Give another address with licenseServer: "https://…". A machine is told apart by a hash of its
name and network cards. In an app on a phone (.NET MAUI) give appId: "com.acme.reader": the key
must be for mobile apps and name the app.
One key per SDK. A key is made for the Server SDK (this package on a server), the Web SDK
(the viewer in websites) or the Mobile SDK (apps); make each in your DocuVerse account under Keys.
Used with another — a Web SDK key in License.SetKey on a server — SetKey throws a
UdsException whose LicenseWrongSdk is true and whose message says which key to make, and
documents do not open with it. A Blazor app uses two: a Server SDK key for License.SetKey and a
Web SDK key for the component.
For the Blazor component give LicenseKey (and, in an app on a phone, AppId):
<PdfViewer LicenseKey="@Configuration["DocuVerse:LicenseKey"]" />
Without a key it shows where to get one instead of the Open button.
Requirements
The engine: .NET 6 or later (or .NET Framework 4.6.1+) on Windows, Linux or macOS, x64 or Arm64. The Blazor component: .NET 10 ASP.NET Core, Blazor Server or a Blazor Web App with the interactive server render mode.
License
MIT. Copyright (c) 2026 Octopi Digital LLC.
| Product | Versions 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 was computed. 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 was computed. 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. |
-
.NETStandard 2.0
- No dependencies.
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.