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