问题与itextsharp [英] issue with itextsharp

查看:85
本文介绍了问题与itextsharp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用iTextSharp生成PDF文件。

它正在使用小数据正常运行。但是当我试图生成包含大量数据的PDF时,PDF文件的第一页空白,所有数据都从第二页开始打印。



请帮助我。

Hi All,
i am generating PDF file using iTextSharp.
it is running properly with small data. but when i am trying to generate PDF with large data ,then first page of PDF file is coming as blank and all the data are getting print from second page.

Please help me on this.

推荐答案

对于A4尺寸的文件,请使用以下尺寸

For A4 size document use following dimension
var pgSize = new iTextSharp.text.Rectangle(600f, 700f);
                        Document doc = new Document(pgSize, 1.5f, 1.5f, 1f, 0.5f);


                        BaseFont bf = BaseFont.CreateFont("c:\\\\windows\\\\fonts\\\\calibri.ttf", BaseFont.IDENTITY_H, false);


使用此diamention创建pdf文档;



Create pdf document with this diamention;

Rectangle rec = new Rectangle(PageSize.A4); //PageSize.A4.Rotate()
Document pdfDoc = new Document(rec);





希望这能解决您的问题。



Hope this will resolve your issue.


这篇关于问题与itextsharp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆