Art.DocumentUtilities.Pdf 3.0.0

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

Art.DocumentUtilities

Art.DocumentUtilities provides synchronous, in-memory document utilities for .NET Framework 4.6.2 server code and Dataverse plug-ins. Version 3 splits the former monolithic package into independently installable functional packages while preserving the existing namespaces.

Choose the smallest package

Function NuGet package Main API
Results, diagnostics, exceptions, limits Art.DocumentUtilities.Core ProcessingResult<T>, DocumentProcessingLimits
HTML templates and Dataverse retrieval Art.DocumentUtilities.DataverseTemplates HtmlTemplateRenderer, DataverseHtmlTemplateRenderer
HTML → PDF Art.DocumentUtilities.Pdf HtmlToPdfConverter
DOCX and XLSX/XLSM Art.DocumentUtilities.OpenXml DocxProcessor, XlsxProcessor
Image metadata Art.DocumentUtilities.Images ImageInspector
QR and barcodes Art.DocumentUtilities.Barcodes CodeImageGenerator
Old combined converters/contracts Art.DocumentUtilities.Legacy DocumentConverter, LegacyWordProcessingAdapter
All features and compatibility facade Art.DocumentUtilities Umbrella package; not recommended for new narrow consumers
flowchart TD
    Templates[DataverseTemplates] --> CRM[Microsoft.CrmSdk.CoreAssemblies\ncompile assets only]
    Images --> Core
    Barcodes --> Core
    Barcodes --> Images
    Barcodes --> ZXing[ZXing.Net]
    OpenXml --> Core
    OpenXml --> Images
    OpenXml --> DFO[DocumentFormat.OpenXml]
    OpenXml --> HAP[HtmlAgilityPack]
    Pdf --> Core
    Pdf --> HAP
    Pdf --> PDFsharp
    Legacy --> Barcodes
    Legacy --> OpenXml
    Legacy --> Pdf
    Umbrella[Art.DocumentUtilities] --> Templates
    Umbrella --> Legacy

There are no cycles. Core has no external NuGet dependency. DataverseTemplates + Pdf does not restore or reference Open XML or ZXing. Open Sans font files are embedded only in the PDF-capable assemblies, so PDF conversion does not depend on machine fonts.

Install

dotnet add package Art.DocumentUtilities.DataverseTemplates
dotnet add package Art.DocumentUtilities.Pdf

Other examples:

dotnet add package Art.DocumentUtilities.OpenXml
dotnet add package Art.DocumentUtilities.Barcodes
dotnet add package Art.DocumentUtilities.Images

Use dotnet add package Art.DocumentUtilities only when an existing application needs the complete legacy surface. New Dataverse plug-ins should reference DataverseTemplates and the specific functional packages they use.

Dataverse template → HTML → PDF

using Art.DocumentUtilities.Pdf;
using Art.DocumentUtilities.Templates;

HtmlTemplateRenderResult rendered = DataverseHtmlTemplateRenderer.RenderWithTextAttribute(
    service,
    templateTableLogicalName: "art_documenttemplate",
    templateNameColumnLogicalName: "art_name",
    mainTableColumnLogicalName: "art_maintablelogicalname",
    templateHtmlFileColumnLogicalName: "art_htmlfile",
    templateTextAttributeLogicalName: "art_subject",
    templateName: "Welcome email",
    mainTableLogicalName: "account",
    mainRecordId: accountId,
    tracingService: tracingService);

byte[] pdf = new HtmlToPdfConverter().Convert(rendered.Html).Value;
string subject = rendered.Text;
Guid templateId = rendered.TemplateId;

Microsoft.CrmSdk.CoreAssemblies is declared by DataverseTemplates with runtime assets excluded. Dataverse supplies those platform assemblies; they are not copied into a plug-in package by this library.

DOCX, XLSX, images, and barcodes

using Art.DocumentUtilities.Docx;

var options = new DocxTransformOptions();
options.Replacements.Add(new DocxReplacement
{
    Type = DocxReplacementType.Text,
    Placeholder = "{{customerName}}",
    Text = "Ada Lovelace"
});

byte[] transformed = new DocxProcessor().Transform(templateBytes, options).Value;
using Art.DocumentUtilities.Xlsx;

var options = new XlsxTransformOptions();
options.Operations.Add(new XlsxCellFill
{
    SheetIndex = 0,
    RowIndex = 1,
    ColumnIndex = 2,
    Value = WorkbookCellValue.Decimal(1234.50m)
});

byte[] transformed = new XlsxProcessor().Transform(workbookBytes, options).Value;

Every transforming operation returns ProcessingResult<T>. Inspect Diagnostics for stable non-fatal warning codes. Invalid documents, unsupported features, and resource-limit violations throw exceptions in Art.DocumentUtilities.Processing.

Bounded processing

HTML conversion supports paragraphs, headings, line breaks, inline bold/italic/underline, lists, simple tables without spans, and block-level base64 PNG/JPEG/BMP images. DOCX-to-PDF remains available through the compatibility package. Scripts, external resources, arbitrary CSS, SVG, positioned layouts, Word fields, tracked changes, charts, SmartArt, and other layout-engine features are rejected.

The default profile allows 16 MiB compressed input, 128 MiB expanded OOXML, 32 MiB output, 2,048 ZIP entries, a 100:1 entry compression ratio, 25-megapixel images, 1,000 ordered operations, and one million extracted worksheet cells. Callers can supply stricter DocumentProcessingLimits.

Build, test, pack, and verify

dotnet restore Art.DocumentUtilities.sln
dotnet build Art.DocumentUtilities.sln -c Release --no-restore
dotnet test Art.DocumentUtilities.sln -c Release --no-build
dotnet pack Art.DocumentUtilities.sln -c Release --no-build -o artifacts/packages
dotnet restore smoke/DataversePdfPackageConsumer/DataversePdfPackageConsumer.csproj
dotnet build smoke/DataversePdfPackageConsumer/DataversePdfPackageConsumer.csproj -c Release --no-restore
./smoke/DataversePdfPackageConsumer/bin/Release/net462/DataversePdfPackageConsumer.exe
dotnet restore smoke/UmbrellaPackageConsumer/UmbrellaPackageConsumer.csproj
dotnet build smoke/UmbrellaPackageConsumer/UmbrellaPackageConsumer.csproj -c Release --no-restore
./smoke/UmbrellaPackageConsumer/bin/Release/net462/UmbrellaPackageConsumer.exe
./build/Verify-Packages.ps1

See MIGRATION.md for upgrading from 2.x and docs/PUBLIC-API.md for the package ownership inventory.

Product Compatible and additional computed target framework versions.
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 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 Art.DocumentUtilities.Pdf:

Package Downloads
Art.DocumentUtilities

Backward-compatible umbrella package for all Art.DocumentUtilities functional packages.

Art.DocumentUtilities.Legacy

Compatibility facade for the original combined DocumentConverter and legacy WebAPI contracts.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 88 9/18/2026