A .NET library to render PDF files into images.
A .NET library to render PDF files into images.
This .NET library is built on top of
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.
Window → Package Manager.+ button (top-left corner) and select Add package from git URL....Add button:https://github.com/sungaila/PDFtoImage.git?path=etc/UnityPackage
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.
// 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));Note: This namespace is used for backward compatibility and will be removed in a future version.
using PDFtoImage;
using Conversion = PDFtoImage.Compatibility.Conversion;