ralfstuckert / pdfbox-layout

MIT License
155 stars 74 forks source link

Absolute positioning #50

Closed literakl closed 6 years ago

literakl commented 6 years ago

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?

ralfstuckert commented 6 years ago

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

literakl commented 6 years ago

Yes it did thanks.