ImageSharpCommunity.Formats.Pdf
4.0.0
dotnet add package ImageSharpCommunity.Formats.Pdf --version 4.0.0
NuGet\Install-Package ImageSharpCommunity.Formats.Pdf -Version 4.0.0
<PackageReference Include="ImageSharpCommunity.Formats.Pdf" Version="4.0.0" />
<PackageVersion Include="ImageSharpCommunity.Formats.Pdf" Version="4.0.0" />
<PackageReference Include="ImageSharpCommunity.Formats.Pdf" />
paket add ImageSharpCommunity.Formats.Pdf --version 4.0.0
#r "nuget: ImageSharpCommunity.Formats.Pdf, 4.0.0"
#:package ImageSharpCommunity.Formats.Pdf@4.0.0
#addin nuget:?package=ImageSharpCommunity.Formats.Pdf&version=4.0.0
#tool nuget:?package=ImageSharpCommunity.Formats.Pdf&version=4.0.0
ImageSharpCommunity.Formats.Pdf
Image decoder for PDF files for ImageSharp based on PdfLibCore
Compatibility
Version 4.0.0 targets .NET 8 or later and ImageSharp 4. The package major version follows ImageSharp. Use version 0.2.0 for ImageSharp 3.
An assembly-scoped Six Labors Community license is included in sixlabors.lic and configured through Directory.Build.props for building the PDF library locally and in CI. It expires on 2028-02-10. Six Labors permits publishing assembly-scoped Community licenses.
The TestWebApp sample directly references ImageSharp.Web and requires a Community license covering that assembly for Release builds. Debug builds can continue with a licensing warning.
Install
via NuGet:
PM> Install-Package ImageSharp.Community.Formats.Pdf
Usage
using System.IO;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats.Png;
using SixLabors.ImageSharp.Processing;
using ImageSharpCommunity.Formats.Pdf;
// Create custom configuration with PDF decoder
var configuration = new Configuration(
new PdfConfigurationModule());
using var inputStream = File.OpenRead("/path/to/document.pdf");
using var image = Image.Load(inputStream);
// Resize
image.Mutate(x => x.Resize(image.Width / 2, image.Height / 2));
// Save image
image.SaveAsPng("document.png");
More info https://docs.sixlabors.com/articles/imagesharp/configuration.html
Usage in Umbraco
To use in Umbraco, you must inject the configuration in an appropriate manor, eg. in a Composer.
using Umbraco.Cms.Core.Composing;
namespace MyUmbracoProject;
public class PdfFormatComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
var config = SixLabors.ImageSharp.Configuration.Default.Clone();
config.Configure(new ImageSharpCommunity.Formats.Pdf.PdfConfigurationModule());
}
}
This will be picked up by Umbraco when starting the website, and adds the necessary configuration.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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 was computed. 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. |
-
net8.0
- PdfLibCore (>= 2.5.0)
- SixLabors.ImageSharp (>= 4.1.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.