Pysar.Uno 0.1.38

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

Pysar.Uno

Uno Platform integration for Pysar, a cross-platform report engine for .NET: packaged asset access, font registration, a scrollable, zoomable ReportView and PDF printing. It installs a UnoReportPlatformHandler for file and font access.

One net10.0 target covers every Uno Skia host — Desktop, WebAssembly, Android and iOS. The Windows App SDK head is not supported yet.

dotnet add package Pysar.Uno

Built against Uno Platform 6.7. Your application keeps whatever SkiaSharp its Uno host asks for; the one Pysar renders through is resolved alongside it, which is the arrangement the Avalonia package has always used.

Packaging report assets

Assets are EmbeddedResource items whose LogicalName is the exact path the report asks for:

<ItemGroup>
  <EmbeddedResource Include="Fonts\**" LogicalName="Fonts/%(Filename)%(Extension)" />
  <EmbeddedResource Include="Images\**" LogicalName="Images/%(Filename)%(Extension)" />
  <EmbeddedResource Include="Styles\**" LogicalName="Styles/%(Filename)%(Extension)" />
</ItemGroup>

Embedded resources rather than the ms-appx:/// URIs an Uno application usually reaches for, because asset reads here have to be synchronous. SkiaFontCollection.AddFont, a ResourceDictionary Source in .rxaml and the image renderer all read without awaiting; StorageFile is asynchronous, and on the WebAssembly host blocking on it is a deadlock on the single thread rather than a stall. A manifest resource is readable synchronously on every host.

An application that already ships its assets as Content can fetch them once at startup instead:

await PysarUno.UseAsync(
    typeof(App).Assembly,
    ["Fonts/Ubuntu-Regular.ttf", "Images/logo.svg"],
    pysar => pysar.AddFont("Fonts/Ubuntu-Regular.ttf", "Ubuntu"));

Every read after that is a dictionary lookup, so the synchronous callers are satisfied.

Setup

protected override void OnLaunched(LaunchActivatedEventArgs args)
{
    PysarUno.Use(typeof(App).Assembly, pysar => pysar
        .AddFont("Fonts/Ubuntu-Regular.ttf", "Ubuntu")
        .AddFont("Fonts/Ubuntu-Bold.ttf", "Ubuntu", FontStyle.Bold));

    // ... the rest of your launch
}

A static entry point rather than a service registration: an Uno application is a Microsoft.UI.Xaml.Application and has no service collection of its own unless it also uses Uno.Extensions. Use returns the handler, for an application that needs it beyond what ReportView wires up.

Showing a report

xmlns:pysar="using:Pysar.Uno"

<pysar:ReportView Report="{Binding Report}"
                  ZoomMode="FitWidth"
                  Zoom="{Binding Zoom}"
                  EffectiveZoom="{Binding EffectiveZoom}"
                  CurrentPage="{Binding CurrentPage}"
                  PageSpacing="24" />

The report must already have Build() called.

Property
Report The built report to show
ZoomMode FitWidth, FitPage or Custom
Zoom The factor used when ZoomMode is Custom; 1 is 100%
EffectiveZoom What the current mode actually resolved to — read this to display a percentage, since Zoom holds what was asked for
CurrentPage The page at the top of the viewport, one-based; two-way
PageCount Pages in the built report
PageSpacing The gap between two pages
PageBorderColor, PageBorderThickness The line framing each page; thickness 0 leaves it unframed
DocumentPadding The space between the viewport edges and the document
VerticalOverdraw How far past the viewport to keep tiles sharp, as a fraction of its height
RenderBudget Megabytes the visible pages may occupy before pages stop being drawn whole
RenderFailed Raised when a report could not be prepared or a page could not be drawn

Ctrl or the platform command key with the wheel zooms around the pointer; a plain wheel scrolls. A trackpad or touch pinch zooms, and a double tap magnifies and returns.

Only the visible region is rasterised, so memory follows the size of the viewport rather than the zoom level. The arithmetic behind that — page geometry, zoom, tile planning — lives in Pysar.Viewer and is shared with every other platform package.

Printing

var printer = new UnoReportPrinter(PysarUno.Renderer);
await printer.PrintAsync(builtReport);

Desktop only. macOS shows the system Print panel through PDFKit, Windows uses the shell print verb, and Linux opens the PDF in the default viewer to print from there.

Android, iOS and WebAssembly throw PlatformNotSupportedException: each of their print paths belongs to an activity, a view controller or the browser, and none is reachable from a class library without that platform's own target framework — which this package deliberately does not have. Produce the bytes yourself on those hosts and share or download them:

var pdf = await PysarUno.ExportService.ExportAsync(builtReport, ExportFormat.Pdf);

Documentation

License

MIT — see LICENSE.

Product Compatible and additional computed target framework versions.
.NET 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. 
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
0.1.38 19 9/14/2026

### Added
- `Pysar.Uno`: a new platform package for [Uno Platform](https://platform.uno/). One `net10.0` target covers every Uno Skia host - Desktop, WebAssembly, Android and iOS - and it brings the same `ReportView` the other platform packages do: a scrollable, zoomable viewer that rasterises only the visible region, so memory follows the viewport rather than the zoom level. Built against Uno 6.7.
- `PysarUno.Use(assembly, configure)` / `PysarUno.UseAsync(...)` (`Pysar.Uno`): registration for an Uno application, called from `OnLaunched`. A static entry point rather than a service registration, because an Uno application has no service collection of its own unless it also uses Uno.Extensions. Returns the handler, and exposes the shared `PysarUno.Renderer` and `PysarUno.ExportService`.
- `UnoReportPlatformHandler` and `UnoAssetFileSystem` (`Pysar.Uno`): report assets are read from embedded resources whose `LogicalName` is the path the report asks for. Embedded rather than `ms-appx:///` because font registration, `ResourceDictionary` sources and image loading all read synchronously, and blocking on Uno's asynchronous `StorageFile` deadlocks the single-threaded WebAssembly host. `UnoAssetFileSystem.PreloadAsync` fetches `Content`-packaged assets once at startup for applications that would rather keep them that way.
- `UnoReportPrinter` (`Pysar.Uno`): desktop printing through the same vector PDF pipeline as export - the macOS Print panel via PDFKit, the shell print verb on Windows, the default viewer on Linux. Android, iOS and WebAssembly throw `PlatformNotSupportedException`; produce the bytes through `PysarUno.ExportService` and share or download them from the application.
- `MacPinchMonitor` and `MacMagnifyEventArgs` (`Pysar.Core.Platform`, in `Pysar`): an AppKit local event monitor for `NSEventTypeMagnify`, now public and shared by every host that needs it. No user-interface framework tested surfaces a trackpad pinch as a gesture on macOS - it arrives as plain wheel deltas indistinguishable from a two-finger scroll - so a trackpad zoom has to come from AppKit directly. `Start`/`Stop` are no-ops on every other platform.

### Changed
- `MacPinchMonitor` moved from `Pysar.Avalonia`, where it was internal, into `Pysar`. Behaviour is unchanged for Avalonia applications; the type is simply no longer duplicated per host. It is plain P/Invoke against libobjc with no dependency on any user-interface framework, which is why it belongs beside `MacOsPdfPrint` in the core package.
- HarfBuzzSharp moves from 14.2.0 to 14.2.1.1 across every package, managed wrapper and native assets together. Required by Uno, and applied as a family because a split between the managed wrapper and its native assets is a startup crash rather than a build error.
- Docs: the quick start and README now cover Uno alongside the other platforms, including the two places it deviates - registration is `PysarUno.Use` rather than `UsePysar`/`AddPysar`, and assets are embedded resources rather than package URIs.

### Notes
- `Pysar.Uno 0.1.35-preview`, published earlier to the internal feed, is superseded and should not be used. It required an `Uno.WinUI` prerelease that no released `Uno.Sdk` provides, so no standard Uno application could consume it. This release targets stable Uno 6.7 instead and ships as an ordinary stable package.
- The Uno report view has been exercised on macOS Desktop - loading, pagination, zoom modes, and trackpad pinch. Its other hosts (WebAssembly, Android, iOS) build from the same single target but have not yet been run.