Skip to content

sungaila/PDFtoImage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

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 Manager.
  2. Click on the + button (top-left corner) and select Add package from git URL....
  3. Enter the following URL and confirm with the Add button:
https://github.com/sungaila/PDFtoImage.git?path=etc/UnityPackage

Breaking changes in v4.0.0

Starting with v4.0.0 the struct RenderOptions is used for most methods. This is a breaking change when updating from v3.1.0 and older.

Option 1: Migrate to new API

// this will not compile anymore
PDFtoImage.Conversion.SaveJpeg("image.jpg", pdfStream, dpi: 300, rotation: PdfRotation.Rotate90);

// use this instead
PDFtoImage.Conversion.SaveJpeg("image.jpg", pdfStream, options: new(Dpi: 300, Rotation: PdfRotation.Rotate90));

Option 2: Change namespace

Note: This namespace is used for backward compatibility and will be removed in a future version.

using PDFtoImage;
using Conversion = PDFtoImage.Compatibility.Conversion;

Supported runtimes

Tested and supported frameworks