There are different approaches for creating ImageSource
instances when generating PDF files with images with RadPdfProcessing
. Generally, the fastest way to insert image file is to use JPEG or JPEG2000 format and create ImageSource with ImageQuality High as mentioned in this documentation section
. You may take a look at this Github SDK example
showing this and other approaches for inserting images into a PDF document. If your scenario requires inserting an image with transparency you should either provide the image in PNG format or alternatively create EncodedImageData instance from the four channels of an RGBA image as shown in this EncodeRgbaPngImageWithFlateDecode method
. Additionally, in order to reduce the file size and the generation time, you may resize some of the images before inserting them into the RadFixedPage. This may be done for images that have much bigger dimensions than the needed dimensions for rendering them in the PDF file. I am attaching a sample project showing how to reduce the image size significantly without losing the image quality with classes from System.Drawing namespace.
I hope this helps.
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin
, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.