1

My program is supposed to position a set of text boxes with lines in a proper manner in documents. You can find an example below:

Example: text boxes with callout arrows

Here's the information my program has available:

  • Sizes of the text boxes
  • Target area to which their arrow is supposed to point to.
    • To which point exactly in that area the arrow is pointing is not critical (center, closest border)

Now I'm looking for a layouting algorithm providing me the following information:

  • Where to place the text boxes
  • Where to attach the lines on the text boxes
  • Optional: Where to attach the lines on the target boxes (i.e. which exact point to point to)
  • Optional: Where to bend the lines

In addition to that, the following conditions should be adhered to:

  • Text boxes should not overlap each other or target boxes
  • Text boxes may overlap any other document content
  • Optional: minimum line length
  • Optional: lines should not intersect

Is there a suitable layouting algorithm for this kind of problem that I could use as a starting point?

Thanks in advance for your ideas here!

Pascal Kesseli
  • 1,620
  • 1
  • 21
  • 37
  • In document you mean PDF ? or HTML ? using C++ ? – Raptor Jul 18 '13 at 07:57
  • Using C++, yes. The system may be used with PDFs, but also other document types. – Pascal Kesseli Jul 18 '13 at 07:58
  • but editing different type of documents need different strategy. – Raptor Jul 18 '13 at 07:59
  • 1
    Is that so? I know how to display the text boxes in all the documents im targeting. They're placed in an overlay layer in all cases, not adhering to paragraphs or other document-specific features. So I considered it to be an abstract problem of placing boxes with pointers on a plane. – Pascal Kesseli Jul 18 '13 at 08:03
  • 2
    Do you care if the targets the arrows are pointing to are covered by boxes, or should we think of this as boxes pointing to boxes, neither of which may be covered by boxes. – Dave Jul 18 '13 at 10:33
  • Good point. As a matter of fact, the target information that the program has is a whole box itself, but I know how to deduct a suitable target point from that. But I would rather not have any of the boxes overlap these target boxes. I think I'd better adapt the question accordingly. – Pascal Kesseli Jul 18 '13 at 11:35

0 Answers0