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
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