PDFtoImage
PDFtoImage copied to clipboard
A .NET library to render PDF files into images.
PDFtoImage
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
- Open your project and navigate to
Window→Package Manager. - Click on the
+button (top-left corner) and selectAdd package from git URL.... - Enter the following URL and confirm with the
Addbutton:
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;