sungaila / PDFtoImage

A .NET library to render PDF files into images.

Home Page:https://www.sungaila.de/PDFtoImage/

Geek Repo:Geek Repo

Github PK Tool:Github PK 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:

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

About

A .NET library to render PDF files into images.

https://www.sungaila.de/PDFtoImage/

License:MIT License


Languages

Language:C# 91.4%Language:HTML 6.2%Language:CSS 1.5%Language:JavaScript 0.9%