【发布时间】:2015-11-09 19:32:24
【问题描述】:
我正在尝试将图像添加到 pdf 单元格,但出现错误:
参数 1:无法从 'System.Drawing.Image' 转换为 'iTextSharp.text.pdf.PdfPCell'
排队:
content.AddCell(myImage);
这是我的代码:
PdfPTable content = new PdfPTable(new float[] { 500f });
content.AddCell(myImage);
document.Add(content);
myImage 变量属于 Image 类型。我做错了什么?
【问题讨论】:
-
在不知道 API 的情况下,您可能需要创建一个单元格并将图像放在那里,然后使用
content.AddCell(yourCreatedCell);
标签: c# .net asp.net-mvc pdf itext