We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

float width = image.PixelWidth * 0.3f; float height = image.PixelHeight * 0.3f;

Can do somesting like this
                            float width = image.PixelWidth * 0.3f;
                            float height = image.PixelHeight * 0.3f;
to make even large pictures fit on my pdf page ?

5 Replies

CM Chinnu Muniyappan Syncfusion Team September 16, 2016 08:08 AM UTC

Hi Mvxyc, 

Thank you for contacting Syncfusion support. 

Yes, it is possible to fit large image to the PDF page while using PdfGrapics.DrawImage method, could you please refer the below code snippet and sample for more details. 
            //Load the image 
            PdfBitmap bitmap = new PdfBitmap(path);            
 
            //Get the page size 
            SizeF pageSize = page.GetClientSize();            
 
            //Draw the image to the PDF page 
            page.Graphics.DrawImage(bitmap, new RectangleF(PointF.Empty,pageSize)); 

Sample link: 

Regards, 
Chinnu 



MV mvxyc September 17, 2016 11:03 AM UTC

Actiually I need something where any picture will be scaled down to a special resolution ,without loosing the details in its picture, so when i scroll into the image i still get the same detail despite its resolution for example 480X480px (before scaling it was 1200X2800 px) for example


KK Karthik Krishnaraj Syncfusion Team September 19, 2016 12:23 PM UTC

Hi Mvxyc,  
Currently we don’t have direct support to change resolution of the image, but we can achieve using external code to resize the image. I have attached a simple sample for your reference kindly check through it and let us know whether it meets your need. 
Sample Link: 
Thanks, 
Karthik 



MV mvxyc September 20, 2016 05:14 AM UTC

But after zooming in the picture lost all its details , this shouldnt be like this


KK Karthik Krishnaraj Syncfusion Team September 21, 2016 02:51 PM UTC

Hi Mvxyc, 
As we said earlier we don’t have direct support to change resolution of the image, in the meantime we tried to replicate the same using system.drawing even in this case the image details are lost when the image is resized, which tends to be normal behavior. Hence we couldn’t proceed further in this case, let me know if you have any other queries. 
Sample Link: 
Thanks, 
Karthik. 


Loader.
Up arrow icon