我应该使用哪个参考来解析图像 class?

Which Reference should I use to resolve the Image class?

我改编了 here 中的一些代码,尝试将图像添加到我使用 iTextSharp 生成的 PDF 文件中。这是代码:

string imagepath = Server.MapPath("Pictures");
Image gif = Image.GetInstance(imagepath + "/OfficeUseOnlyImg.png");
doc.Add(gif);

"Image"class无法识别,所以我右键解决了;我对财富的尴尬感到吃惊 - Picturelypse 的四个参考资料都提供了他们的服务:

那么我应该选择哪一个呢?我认为是 iTextSharp 参考文献之一,但首选哪一个?

iTextSharp.tool.* 内容是 XML Worker 的一部分,而不是 iTextSharp 核心的一部分。你需要 iTextSharp.text.Image.

iTextSharp.tool.xml.html.Image class 是将 <img> 标签映射到 iTextSharp.text.Image 对象的 class。除非你想调整 XML Worker.

,否则你不应该使用它