Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.SVG.Drawing.SkiaSharp is a complete Aspose.SVG for .NET build that uses
SkiaSharp for drawing and rendering. It provides the Aspose.SVG document, DOM, conversion, and rendering APIs in a package intended for applications that target Windows, Linux, or macOS.
Starting with
Aspose.SVG for .NET 25.5, this package is no longer an add-on to Aspose.SVG. It is a self-contained build. Reference Aspose.SVG.Drawing.SkiaSharp as the Aspose.SVG package for the project; do not add an extension module or call SetExtension(new SkiaModule()).
Use Aspose.SVG.Drawing.SkiaSharp when an application needs:
The standard Aspose.SVG package depends on System.Drawing.Common. Microsoft identifies System.Drawing.Common as Windows-specific starting with .NET 6 and documents that,
from .NET 7, it cannot be re-enabled on non-Windows operating systems.
Install the
Aspose.SVG.Drawing.SkiaSharp NuGet package instead of installing the standard Aspose.SVG package together with a SkiaSharp add-on.
For a PackageReference project, add the package with the version selected for your application:
1<ItemGroup>
2 <PackageReference Include="Aspose.SVG.Drawing.SkiaSharp" Version="<version>" />
3</ItemGroup>The package targets .NET Standard 2.0. For framework and platform details, see System Requirements.
After the SkiaSharp build is referenced, use the standard Aspose.SVG API. No rendering-module registration is required.
1using System.IO;
2using Aspose.Svg;
3using Aspose.Svg.Converters;
4using Aspose.Svg.Saving;
5
6// Load the source SVG document
7using (SVGDocument document = new SVGDocument(Path.Combine(DataDir, "source.svg")))
8{
9 // PNG is the default output format for ImageSaveOptions
10 ImageSaveOptions options = new ImageSaveOptions();
11
12 // Render the SVG document to a PNG image through the SkiaSharp build
13 Converter.ConvertSVG(document, options, Path.Combine(OutputDir, "result.png"));
14}For additional image formats and rendering settings, see Convert SVG to Images in C#.
With Aspose.SVG.Drawing.SkiaSharp, applications can render SVG content to:
Applications can also save edited or generated SVG document content as SVG or SVGZ. Rendered output can depend on fonts, external resources, effects, and rendering settings. Before deploying a rendering service, review SVG Rendering Quality and Output Consistency.
Linux deployments using Aspose.SVG.Drawing.SkiaSharp require native Skia binaries. Published Aspose.SVG guidance lists the packages below; check that the selected package matches the SkiaSharp version, Linux distribution, and CPU architecture used by your application:
SkiaSharp.NativeAssets.Linux – native Skia build for x64 Debian-based Linux distributions.SkiaSharp.NativeAssets.Linux.NoDependencies – for Linux distributions without the libfontconfig dependency; tested on RHEL 7 (x64).Goelze.SkiaSharp.NativeAssets.AlpineLinux – native Skia build for x64 Alpine Linux 3.9; NuGet marks this legacy package as deprecated and no longer maintained.Jellyfin.SkiaSharp.NativeAssets.LinuxArm – native Skia build for arm32 and arm64 Debian-based Linux distributions; its latest NuGet release is a legacy SkiaSharp 1.68.1 package.Deploy any fonts required by the SVG documents along with the application. Missing fonts can change text layout and the appearance of generated PDFs or images.
Projects built with versions before 25.5 may reference both Aspose.SVG and Aspose.SVG.Drawing.SkiaSharp and activate Skia rendering in code:
1Aspose.Svg.Configuration.SetExtension(new SkiaModule());For Aspose.SVG for .NET 25.5 and later:
Aspose.SVG.Drawing.SkiaSharp.Aspose.Svg.Configuration.SetExtension(new SkiaModule()).The Aspose.SVG for .NET 25.5 release notes describe this package change and the related rendering API update.
1. What is SkiaSharp?
SkiaSharp is an open-source 2D graphics API, stemming from Google’s Skia library. It is renowned for its high-quality rendering capabilities. By availing advanced graphics features and APIs, SkiaSharp is perfect for mobile apps, games, and even server applications.
2. Should a new cross-platform project install both Aspose.SVG and Aspose.SVG.Drawing.SkiaSharp?
No. For Aspose.SVG for .NET 25.5 and later, Aspose.SVG.Drawing.SkiaSharp is the complete Aspose.SVG build that uses SkiaSharp rendering. Install it as the Aspose.SVG package for a project that needs this rendering backend.
3. Does switching to the SkiaSharp build change the code that converts SVG files?
For high-level operations such as Converter.ConvertSVG(...), use the same Aspose.SVG API after referencing the SkiaSharp build. The migration change is to remove the former SetExtension(new SkiaModule()) activation call and test the output important to the application.
4. Why can a Linux container still need additional packages after installing Aspose.SVG.Drawing.SkiaSharp?
The .NET package uses native Skia binaries at runtime. A Linux container must provide native assets compatible with its distribution, CPU architecture, and SkiaSharp version. It may also need fonts used by the SVG documents being rendered.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.