Hi dahami,
Thanks for your post.
I tested the scenario but don't found any issue. Below is my testing code.
- Code: Select all
string outputFile = @"output.pdf";
PdfDocument doc = new PdfDocument();
PdfPageBase page = doc.Pages.Add();
PdfGrid grid = new PdfGrid();
grid.Style.CellPadding = new PdfPaddings(1, 1, 1, 1);
PdfGridRow row = grid.Rows.Add();
grid.Columns.Add(2);
float width = page.Canvas.ClientSize.Width - (grid.Columns.Count + 1);
grid.Columns[0].Width = width * 0.25f;
grid.Columns[1].Width = width * 0.25f;
PdfGridCellContentList lst = new PdfGridCellContentList();
PdfGridCellContent textAndStyle = new PdfGridCellContent();
textAndStyle.Image = PdfImage.FromFile("image1.jpg");
textAndStyle.ImageSize = new SizeF(50, 50);
lst.List.Add(textAndStyle);
row.Cells[0].Value = lst;
PdfLayoutResult result = grid.Draw(page, new PointF(10, 30));
doc.SaveToFile(outputFile, FileFormat.PDF);
System.Diagnostics.Process.Start(outputFile);
I have attached the input image and output document with name "File.zip" for your kind reference.
If the issue still troubles you, please provide following information for further investigation.
1. The input image and the code you were using.
2. OS and Region information, e.g. Win7 64bit, China/Chinese.
Login to view the files attached to this post.