How can add space\margin between two elements in iTextSharp\iText? How can add space\margin between two elements in iTextSharp\iText? asp.net asp.net

How can add space\margin between two elements in iTextSharp\iText?


You have a couple of different options. You could set the SpacingAfter on your paragraph:

titolo.SpacingAfter = 20;

You could also set the SpacingBefore on the table:

table.SpacingBefore = 20;

Or you could just add some returns to your paragraph:

iTextSharp.text.Paragraph titolo = new iTextSharp.text.Paragraph("Hello World\n\n");


Use set margins to adjust the padding space of your page.

Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f);pdfDoc.SetMargins(20f, 20f, 20f, 20f);

You can adjust the size value according to your need.