In this example, each page is saved in a separate file. Model.RadFixedDocument fixedDocument = pdfFormatProvider.Import(fileBytes) Īfter having the document imported, you can now convert its pages to images through the Export method. The first step we need to implement is to read the PDF document we already have: byte fileBytes = File.ReadAllBytes("SampleDocument.pdf") Once we are ready with the setup, we can continue to add some logic to our application. There are versions for Windows, MacOS, Linux, WebAssembly, Android, iOS and others. This package may differ according to the used platform. The SkiaSharp.NativeAssets.* NuGet package..Image.SkiaĪs I mentioned earlier, the image exporting functionality depends on SkiaSharp, thus you will need to add dependencies to its binaries as well:.dll files, here is the list of required assemblies: In case you prefer adding references to the. Package that will download all of its dependencies automatically: For more convenience, I will directly go with the .Image.Skia NuGet To better demonstrate the functionality and its usage, I will guide you step by step on creating an application that opens an existing PDF document and converts its pages into images.įirst things first-I will create a console application and add the dependencies we need to use the PdfProcessing library. Information from this model into a document file, respectively. For all the rest, in short, the format providers expose Import and Export methods that enable you to parse a document into the internal model of the library or save the If you are already using PdfProcessing, you should be familiar with the format providers and how they work. The entry point making all the magic is the SkiaImageFormatProvider class. Let’s take a closer look at the API related to the new functionality. Multiple image formats are supported,Īnd you can also choose whether to perform the exporting operation synchronously or asynchronously. Library uses a third-party tool for image generation- SkiaSharp. NET Standard version of PdfProcessing to create images, the To make it possible for all platforms using the. This functionality and I will present it in this blog post. As we are always listening to your feedback, during the last release we worked hard to provide you with Many of you requested us to provide you with the ability to export your documents or parts of them to images in. Check out the new functionality of Telerik PdfProcessing to convert PDF pages to images.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |