PDFtoImage 5.4.0

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

PDFtoImage Logo PDFtoImage

GitHub Workflow Build Status GitHub Workflow Test Runs Succeeded SonarCloud Quality Gate NuGet version NuGet downloads Website GitHub license

A .NET library to render PDF files into images.

This .NET library is built on top of

Getting started

Call a static method from PDFtoImage.Conversion. Here is an example of how to render the first page of a PDF file as a PNG image:

using var pdf = File.OpenRead("document.pdf");

PDFtoImage.Conversion.SavePng(
    imageFilename: "page1.png",
    pdfStream: pdf,
    page: 0);

SaveJpeg, SavePng, SaveWebp and ToImage for a single page.

ToImages and ToImagesAsync for multiple pages.

Note: SkiaSharp.SKBitmap can be exported with the Encode method.

Unity project installation

  1. Open your project and navigate to WindowPackage ManagementPackage Manager.
  2. Click on the + button (top-left corner) and select Install package from git URL....
  3. Enter the following URL and confirm with the Install button:
https://github.com/sungaila/PDFtoImage.git?path=etc/UnityPackage

Supported runtimes

Tested and supported frameworks

No parallelization support

The native PDFium library used by this project for rendering is not thread-safe. For that reason, all calls into PDFium are protected with locks.

This means that you can only process one PDF at a time.

If you need true parallel processing, you’ll have to spawn multiple processes and distribute the workload across them, then collect the results using inter-process communication (IPC) and appropriate serialization.

Ghostscript may be easier for this use case, since (under certain conditions) it can support multiple instances within the same process.

Index and Range for .NET Framework

PolySharp is used to enable the use of System.Index and System.Range in .NET Framework projects. As a side effect, the following classes are generated and exposed, which should not be used directly by your project:

  • System.Index
  • System.Range
  • System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute
  • System.Diagnostics.CodeAnalysis.NotNullWhenAttribute
  • System.Runtime.CompilerServices.IsExternalInit
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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.