ralfstuckert / pdfbox-layout

MIT License
156 stars 74 forks source link

Frame around a set of paragraphs possible? #64

Closed arnthom closed 6 years ago

arnthom commented 6 years ago

In my pdf I have a set of paragraphs constisting of normal paragraphs with text and a column layout to have a table with some values. Now I would like to put a frame around this and may use some background color to highlight this text area.

A frame around a simple paragraph can be used without any problem. But how do I define a frame around this set:

How can I define a frame that overlaps a set of paragraphs? How can I get the positions to stat and end the frame?

This would be easy with nested layouts or a table object. Is there a time line for these? I know, you are busy with other stuff, Ralf ... but do you have some code to test and maybe develop together?

ralfstuckert commented 6 years ago

Nested layout is the key to all open features. Alas, this would require a complete rewrite of the layout engine...that's why they are all still open :-/ Sorry

arnthom commented 6 years ago

I have found a workaround for my situation... I have switched to a set of columns with only one paragraph (but many lines) in each column. A Frame is defined around the paragraph in the first column and the width of the frame is set to documnet width. So I can create the text of the paragraphs depending on the special case and use a fixed width and variable height of the frame. I have to admit, that the final paragraphs (in vertical layout) does not go into the frame, but I can live with that ...