Reputation: 9038
I am not sure how to add the gray line like in the image b/w paragraphs in Itext 7.
Should I use rectangle for this with very small width and the whole page length?
Rectangle rect= new Rectangle(1, 400);
How to get whole page length as opposed to hard code the same?
Upvotes: 0
Views: 113
Reputation: 12312
You can use the following piece of code:
Document document = new Document(pdfDocument);
document.add(new Paragraph("Hello"));
document.add(new Div().setHeight(5).setBackgroundColor(ColorConstants.LIGHT_GRAY));
document.add(new Paragraph("World"));
document.close();
To achieve the result as displayed on the image:
Upvotes: 1