In iText7 I need to create 5 lines of text at the top of a document that are centered to the page. The easiest way I found to do this is:
doc.add(new Paragra
Paragraph has 2 methods for handling what is known as the leading.
Paragraph o1 = new Paragraph("");
o1.setMultipliedLeading(1.0f);
Multiplied leading is when you specify a factor of how big the leading will be compared to the height of the font.
You can also set it document wise:
document.setProperty(Property.LEADING, new Leading(Leading.MULTIPLIED, 1.2f));
In my case with iText7, I used SetMarginTop(0f) and SetMarginBottom(0f) to make it.