The position of the bookmarks are calculated with the wrong position. They use relative position of the text elements instead of absolute position on a page.
I am using the anchorNameExpression-tag and the bookmarkLevel-attribute on textField elements which automatically create bookmark in pdf when the jasperPrint is exported as pdf.
What I do is the following:
I got a jrxml which contains the following elements
- textField1 (position x=10, y=10)
- a frame2 (position x= 50, y=50), which contains itself a textField2 (position x=5, y=5)
I have added the following anchors in jrxml:
- textField1: anchorName="bookmark1", bookmarkLevel=1
- textField2: anchorName="bookmark2", bookmarkLevel=1
What happens is that the bookmarks in pdf will have the following positions:
bookmark1: position x=10, y=10
bookmark2: position x=5, y=5
-> the bookmarks should have the absolut position on the page, calculated with all its surrounding container:
bookmark2: position x=55 ( sum of the x-position of the frame and the x-position of the textField2). Same for y-position