I'm doing good in my c# program and lately have a problem with resizing an image to fit a PDF page. Basically, i import the image and set the width to match the width of PDF and i get loss of image resolution. The gray scale isn't clear as it supposed to be.
Can anyone help me out? Any example i could look at to point me in the right direction?
This article on XsPDF.com is what are you looking for, check out: Create PDF from image in C#.
Answers
XsPDF library will keep the original rendered image size for each PDF page. Certainly, it will not alter the image. However, different Windows system will give rise to some exceptions. In some cases, Windows system will reduces the number of grayscale during getting the image data. So, we suggest you to have a try with different raster images and some of them should work as expected. You may try with image formats JPG/JPEG, PNG, GIF, BMP, TIF, and TIFF.
Hi, support. Thanks for your quick response. As you mentioned it is caused by Windows system, i just wondering is there any way to avoid this? I want to get the image with the least loss.
Hi, dude...i have get this through by using System.Drawing and System.Drawing.Imaging. I re-scale the image before using method to draw it.
Cannot agree! You don't have to re-scale image. I think you should better to load the image and directly pass it to the library. This may be a great helpful to prevent the system from messing the image up.