ralfstuckert/pdfbox-layout

Absolute positioning

Closed this issue · 2 comments

I like pdfbox-layout very much. But it seems that it does not fit my purpose. Or I failed to learn it well. I want to place various sections across the page at precise location and add there either paragraph or image. For example one picture on left, another on right and text below the picture aligned to it, both 5 cm from top. Then there will be a paragraph starting 10cm from top of the page. Etc. Is this possible?

You can set an absolute position via setAbsolutePosition() which is available on TextFlow, Paragraph, Image, etc.. If an absolute position is given, the renderer will ignore the current layout flow and render it at the given position. In https://github.com/ralfstuckert/pdfbox-layout/blob/master/examples/letter.pdf resp. Letter.java the footer is set using an absolute position. Hope this helps

Yes it did thanks.