首页 新闻 会员 周边

关于iTextSharp创建PDF的问题

0
[已解决问题] 解决于 2009-03-06 09:20

用iTextSharp.dll创建PDF,PDF里定义有table,怎样设置行高呢?或者设置行里的水平对齐为middle,我只能设置垂直居中,水平的不能设置,有设置过的朋友,请帮忙一下

风浪的主页 风浪 | 老鸟四级 | 园豆:2996
提问于:2009-03-04 09:35
< >
分享
最佳答案
0

Hi FengLange,

here is some reference from class library which defined Table method, just for your Ref.

 

public Table(int columns, int rows) : base(0, 0, 0, 0) {
            Border = BOX;
            BorderWidth = 1;
            defaultLayout.Border = BOX;

            // a table should have at least 1 column
            if (columns <= 0) {
                throw new BadElementException("A table should have at least 1 column.");
            }
            this.columns = columns;

            // a certain number of rows are created
            for (int i = 0; i < rows; i++) {
                this.rows.Add(new Row(columns));
            }
            curPosition = new System.Drawing.Point(0, 0);

            // the DEFAULT widths are calculated
            widths = new float[columns];
            float width = 100f / columns;
            for (int i = 0; i < columns; i++) {
                widths[i] = width;
            }

Regards,

Robin

稻草人 | 初学一级 |园豆:83 | 2009-03-04 12:13
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册