Free Support Forum - aspose.com

Hi Res Images in PDF file

Hi,

I’m trying to include a ‘hi-res’ image into my PDF file. But it seems that I can only supply an image whose height and width (ie resolution???) is limited by the size of the page. I need to be able to take a bitmap of (say) height 1500, width 1100 and fit it onto the A4 page without losing any quality. I know that this will increase the size of my PDF file, but that is OK.

At the moment, I am taking my hi-res image and reducing the size using the HighQualityBilinear interpolation mode of the Graphics.DrawImage method. This does a fair job but is reducing the quality of the image.

Thanks,

Chris.

Dear Chris,

Thanks for your consideration.

You can use Image.ImageScale property to make your image fit A4 page size if your image is in file. But Image.ImageScale can’t work well for bitmap image. Is it possible for you to use image file but not bitmap image?

Thanks for getting back to me.
I’m not sure I understand your question. Are you saying that I need to save my bitmap to a diskfile before I can use Image.ImageScale?

ie:
myBitmap.Save(“c:\temp\tempBmpFile.???”,System.Drawing.Imaging.ImageFormat.???)

Then load it into the Pdf.Image object and do the scaling?
If so, do you recomend any particular format.


Regards,

Chris.

Dear Chris,

Thanks for your consideration.

Since there is problem with bitmap scaling, you have to save your bitmap to diskfile. You’d better save your image as jpeg format. And don’t forget to use EncoderParameter to control the image quality. Please refer to my example in thread Image height/width too large.