I am using iText
to create my PDF files.
I want to position text at some specific place in the document using the method I found here:
Please note that in most PDF generators, PDF page origin is from the left bottom (0,0).
1 inch = 72 points and 1 cm = 1/2.54 inch = 0.3937 inch = 28.3 points.
where,
(lower left x coordinate)l l x=margin from left.
(lower left y coordinate)l l y=margin from bottom(bottom of rectangle)
(upper right x coordinate)u r x=width of article
(upper right y coordinate)u r y=margin from bottom of upper boundary of article.
To draw a Rectangle in PDF, using such generators, which contain A-4 size pages then, you need to define Rectangle as:
rectangle = new Rectangle(25, 25, 575, 820);
rectangle. set Border(Rectangle.BOX);
rectangle. set Border Width(1);
document.add(rectangle);