Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set space between rows in pdfptable

Tags:

itextsharp

I am using iTextSharp for creating the pdf.

Is it possible to provide space between the rows in pdfptable?

like image 765
Giri Avatar asked Nov 06 '12 09:11

Giri


2 Answers

You need to use table events to do that.

Java example: http://itextpdf.com/examples/iia.php?id=95

C# example: http://kuujinbo.info/iTextInAction2Ed/index.aspx?ch=Chapter05&ex=PressPreviews

Note that I made the assumption that you want cell spacing (instead of cell padding) similar to what you can see here: http://examples.itextpdf.com/results/part1/chapter05/press_previews.pdf

like image 133
Bruno Lowagie Avatar answered Oct 22 '22 19:10

Bruno Lowagie


You can add a cell with a fixed colspan, no border and new line phrase like this:

PdfPCell blankRow = new PdfPCell(new Phrase("\n"));
blankRow.setFixedHeight(5f);
blankRow.setColspan(4);
blankRow.setBorder(Rectangle.NO_BORDER);
like image 40
RAFAEL PINO Avatar answered Oct 22 '22 18:10

RAFAEL PINO