弄了两天的itext生成PDF终于入了门,但是还有俩问题一直没找到解决方案,我用的itext版本是5.0.5
1. 如何划一条直线,我现在能画线,但是画了之后就会影响布局
2. 如何调整上下宽度,比如我有个表格。如何调整这个表格和外面内容的间距?下面这个是问题一所想得到的效果 test
___________________________________
1. 如何划一条直线,我现在能画线,但是画了之后就会影响布局
2. 如何调整上下宽度,比如我有个表格。如何调整这个表格和外面内容的间距?下面这个是问题一所想得到的效果 test
___________________________________
用PdfContentByte在指定位置绘图或写字PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("test.pdf"));
PdfContentByte cb = writer.DirectContent;
cb.LineWidth = 10f;
cb.moveTo(100, 700);
cb.lineTo(200, 800);
cb.stroke();
Sets the spacing after this table.
void setSpacingBefore(float spacing)
Sets the spacing before this table.
这个设置表格之间的间距