Morph.Blazor.Pdf 1.35.0

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

Morph.Blazor.Pdf

PDF output for Morph.Blazor: adds PDF to the formats its converter and its editor write, entirely in the browser.

It is a package of its own because PDFs are written by Krilla, a native library, and a WebAssembly app can only use one that is linked into its own .wasm. That makes the app a native build, which needs the wasm-tools workload and adds about 4.7 MB to the runtime the browser downloads (1.7 MB gzipped). An app that only views or edits documents references Morph.Blazor alone and has none of it. Printing and the viewer's pages are not PDF, and need nothing from this package.

Install

dotnet add package Morph.Blazor.Pdf

Set up

Two things, in an app already set up for Morph.Blazor:

  1. Add PDF to what Morph writes:

    builder.Services.AddMorph();
    builder.Services.AddMorphPdf();
    
  2. Make the app a native build, in its project file:

    <PropertyGroup>
      <WasmBuildNative>true</WasmBuildNative>
    </PropertyGroup>
    

    with the workload installed, on CI too:

    dotnet workload install wasm-tools
    

    Set, a missing workload is a build error. Left unset, an app built without the workload builds with a warning, runs, and fails on its first PDF with "krilla_capi could not be loaded". With WasmBuildNative set to false it fails the same way, with no warning.

MorphConverter's picker and MorphEditor's File menu then offer PDF. In code, ConversionService.ToPdf and BuildDownload write one, and ConversionService.WritableFormats has it. AddMorphPdf holds for the whole process, as ConversionService does.

Coming from Morph.Blazor 1.33 and earlier

PDF was part of Morph.Blazor. Nothing has been renamed, so an app that writes PDFs takes the two steps above and changes no other code. An app that does not add this package:

  • is not offered PDF by MorphConverter and MorphEditor, and ConversionService.WritableFormats has no PDF in it. OutputFormat.Pdf is still there, and ConversionService.Find still describes it;
  • gets an InvalidOperationException naming this package from ConversionService.ToPdf, and from BuildDownload with OutputFormat.Pdf. MorphConverter shows it as an error when InitialTarget or Formats asks for PDF;
  • has no Morph.Pdf through Morph.Blazor. Code calling PdfDocumentConverter or ExportToPdf itself references Morph.Pdf;
  • needs no wasm-tools workload on Morph's account, and can drop a WasmBuildNative of false that was there to keep Krilla out. Dropped, and with the workload installed, the SDK relinks a trimmed Release publish as it does any Blazor app's, which without Krilla makes the runtime smaller rather than larger; left in, the runtime is the SDK's own, 3.15 MB.
Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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
1.35.0 0 12/1/2026
1.34.0 38 12/1/2026