2
我试图在ITextSharp中的表格单元格内偏移图像的位置。下面是一些伪代码,概述了我的一些尝试,其中没有一个似乎影响图像的位置。我特别喜欢将图像的中间与单元格的左边缘对齐,但我甚至无法弄清楚如何移动图像。ITextSharp单元格内的图像定位
doc.Open();
var table = new PdfPTable(1);
var cell = new PdfPCell();
var image = Image.GetInstance(); //etc
image.SetAbsolutePosition(-10, 0); //no effect
image.Left -= 10; //no effect
image.IndentationRight = 10; // no effect
cell.AddElement(image);
table.Rows.Add(new PdfPRow(new PdfPCell[] { cell }));
doc.Add(table);