【问题标题】:How to add image file in pdf using itext in asp.net如何在asp.net中使用itext在pdf中添加图像文件
【发布时间】:2013-04-10 09:22:30
【问题描述】:

如何在 asp.net C# 中使用 itextSharp 添加图像文件。以及需要哪个命名空间

Image jpg** = Image.GetInstance(new Uri(URL))

【问题讨论】:

标签: c# asp.net itextsharp


【解决方案1】:

您可以使用iTextSharp.text.Image 添加图片。像这样的:

iTextSharp.text.Image pic = iTextSharp.text.Image.GetInstance(image, System.Drawing.Imaging.ImageFormat.Jpeg);
myDocument.Add(pic);

其中myDocumentDocument的对象@itextsharp类

如果有一篇详细讨论在 itextsharp 中处理图像的文章

http://www.mikesdotnetting.com/Article/87/iTextSharp-Working-with-images

您可能也有兴趣浏览文档,所以这里是链接:

http://sourceforge.net/projects/itextsharp/

【讨论】:

    【解决方案2】:

    你可以试试这个

    使用(Stream ImageStream = new FileStream(imageUrl, FileMode.Open, FileAccess.Read, FileShare.Read))

    Image image = Image.GetInstance(ImageStream);

    【讨论】:

      猜你喜欢
      • 2014-08-18
      • 2017-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多