- Home
- Forum
- ASP.NET MVC (Classic)
- Image in PdfGridCell keeping aspect ratio
Image in PdfGridCell keeping aspect ratio
Hi Truls,
Thank you for using Syncfusion Products.
We can able to keep the same Aspect Ratio of the image into the Pdf Grid cell, please use the below property to position the background image to center with the same aspect ratio. Please let us know if this code snippet satisfied your requirement.
Code Snippet:
pdfGrid.Rows[0].Cells[1].ImagePosition = PdfGridImagePosition.Center;
Please let us know if you need any further assistance.
Thanks,
Karthikeyan.C
Example: Image is 100x50 and the cell is 50x50 px... the image will be resized to 50x50 - I want the image to be resized to 50x25 before it's inserted into the cell.
Hi Truls,
Thank you for your update.
The image can be fit into the Pdf Grid cell by using the following code snippet.
Please use the below code snippet:
pdfGrid.Rows[0].Cells[1].ImagePosition = PdfGridImagePosition.Fit;
Also we have found an issue in our product that when the image width is greater than the image height Fit is not working properly. Please create a Direct trac incident with the title “Forum- 113776- Image in PdfGridCell keeping aspect ratio” for getting the patch for this issue.
Please let us know if you have any concern.
Thanks,
Karthikeyan.C
- 3 Replies
- 2 Participants
-
TR Truls Rødfjell
- Oct 8, 2013 11:13 AM UTC
- Oct 14, 2013 09:59 AM UTC