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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

125986 Sep 15,2016 04:45 PM Sep 21,2016 10:51 AM ASP.NET MVC 5
loading
Tags: PDF
mvxyc
Asked On September 15, 2016 04:45 PM

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 ?

Chinnu Muniyappan [Syncfusion]
Replied On September 16, 2016 04:08 AM

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 


mvxyc
Replied On September 17, 2016 07:03 AM

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

Karthik Krishnaraj [Syncfusion]
Replied On September 19, 2016 08:23 AM

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 


mvxyc
Replied On September 20, 2016 01:14 AM

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

Karthik Krishnaraj [Syncfusion]
Replied On September 21, 2016 10:51 AM

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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;