【发布时间】:2014-06-20 12:55:15
【问题描述】:
我使用 iTextSharp 程序集将 jpg 转换为 pdf。
我的 jpg 由 twain (A4) 扫描。 jpg 不错。
我将我的 png 转换为 pdf 格式:
Document doc = new Document();
PdfWriter.GetInstance(doc, new System.IO.FileStream(this._fileName, System.IO.FileMode.Create));
doc.Open();
iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(Scanners.Twain.GetImage(i), System.Drawing.Imaging.ImageFormat.Jpeg);
doc.SetPageSize(new iTextSharp.text.Rectangle(0, 0, img.Width, img.Height));
doc.NewPage();
doc.Add(img);
doc.Close();
我的问题是 pdf 结果在顶部和底部有点(有点)切割。 为什么?
我怎样才能避免这种情况?
非常感谢,
苏辛
【问题讨论】:
标签: c# .net pdf itextsharp twain