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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

retrieve image dimention info wrong

Thread ID:

Created:

Updated:

Platform:

Replies:

141105 Nov 23,2018 04:58 PM UTC Nov 26,2018 11:55 AM UTC ASP.NET Core - EJ 2 1
loading
Tags: PDF
Tony Qu
Asked On November 23, 2018 04:58 PM UTC

I just want to attach an image on the pdf.
So I use the following code to implement this.
Dim image as new PdfBitmap("c:\temp\20180810.jpg")
Dim iwidth as Single = image.Width
Dim iheight as Single = image.Height
But the weird thing is I found it read the image width as the height and read the image height as the width, then when I draw the image on pdf, it rotate the image 90 degree. Not every image file it read like that, only a few jpg files cause this problem, but it is really annoying as clients complained why their image being rotated.
Please find the attachment is the that image file. Can you shed me a light?
Thanks.

Attachment: 20180810_b5a41868.zip

Karthikeyan Chandrasekar [Syncfusion]
Replied On November 26, 2018 11:55 AM UTC

Hi Tony,  
We have tried the sample to insert image into PDF with the provided image file. We were able to view the wrong image dimension. This behavior occurs because, some Bitmap objects does not take into account the EXIF Orientation tag. The EXIF (Exchangeable Image File Format) standard specifies some set of tags that can be embedded in images. One of these tags specifies the orientation of the image. If it does take into the account, the image get rotated. This behavior will be reproduced even in System.Diagram.Bitmap. However, we have created the sample to draw the image properly to PDF page without any rotation. Please find the sample for the same from below location,  

Please try this workaround sample in your end and let us know whether it solves the issue.    
Regards,  
Karthikeyan   



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

;