根据文档,
iText支持以下图像格式:JPEG,GIF,PNG,TIFF,BMP,WMF和EPS。我不知道这是否有帮助,但是我已经成功地使用iTextSharp将矢量WMF图像嵌入到pdf文件中:
C#:
using System;using System.IO;using iTextSharp.text;using iTextSharp.text.pdf;public class Program { public static void Main() { document document = new document(); using (Stream outputPdfStream = new FileStream("output.pdf", FileMode.Create, FileAccess.Write, FileShare.None)) using (Stream imageStream = new FileStream("test.wmf", FileMode.Open, FileAccess.Read, FileShare.Read)) { PdfWriter.GetInstance(document, outputPdfStream); Image wmf = Image.GetInstance(imageStream); document.Open(); document.Add(wmf); document.Close(); } }}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)