【发布时间】:2018-06-23 09:16:15
【问题描述】:
我想使用 iText7 将图像添加到现有 PDF 文件中的特定位置。
在另一个使用 iTextSharp 的项目中,代码非常简单:
iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(new Uri(fullPathSignature));
// Set img size and location on page
//-------------------------------------
// item.Width, item.Height
img.ScaleAbsolute(120, 62);
// left: item.X bottom: item.Y
img.SetAbsolutePosition(25, 25);
//-------------------------------------
//Add it to page 1 of the document,
PdfContentByte cb = stamper.GetOverContent(1);
cb.AddImage(img);
但我没有找到使用 iText7 的正确方法。
我有一个 PdfReader 和一个 PdfWriter,但我在哪里可以找到 iText7 中的 PdfStamper?
或者也许有不同的方法可以将图像添加到 iText7 中的现有 PDF 文件?
(我不能在当前项目中使用 iTextSharp)
【问题讨论】: