[Java] get bookmark information (vertical position)

Product: SDK java

Hello,

I’m using both java sdk and angular webviewer.
I need to get some informations on bookmarks object server side and in the front.
I need the page number and the vertical position of each bookmark

In angular it’s pretty easy I’m using:

const bookmarks = this.documentViewer.getDocument().getBookmarks();
                  void bookmarks.then(bookmarks => {
                    console.log(bookmarks[0].getVerticalPosition());
                    console.log(bookmarks[0].getPageNumber());
                  });

But it’s difficult to find my way in java.
I managed to get the page number with:
item.getAction().getDest().getPage().getIndex()
but i could not find the vertical position.

Can you help me ?

Rodolphe

Please see this forum post.

In particular this part.

// Now get the vertical coordinate 'top'
double top = dest_arr.GetAt(2).GetNumber();

When i use this code i have the same value for each section (39). it might be the left position.
Testing other value (GetAt(3),GetAt(4),etc) I didn’t find any value close to what i have with my bookmark.getVerticalPosition() in angular.

May I know what these values refer to or May I have a link to the documentation specifying this, I couldn’t find it

Hi,

I double checked and when I use getAt(2) in java I retrieve the “getHorizontalPosition()” from angular.

May I have the complete path to get the top value (it’s unclear in the article you linked).

I used: item.getAction().getDest().getExplicitDestObj().getAt(2).getNumber()

is that what you meant by “dest_arr.GetAt(2).GetNumber()” which is the C# implementation.