New Forum | Previous | Next | (P-PDF) Developers
Topic: Add bookmark at the first position in bookmark list
Conf: (P-PDF) Developers, Msg: 85834
Date: 4/9/2003 08:18 PM
I am working on adobe acrobat plugin development. My work is related to adding new bookmark at the first position in the bookmark list. If there is no bookmark present in the pane then it works ok. The problem arises when we already have some bookmarks in the bookmark pane?
I follow two strategies to cope with this situation but still need help as they are not working 100% fine,
- I just get the reference of the first bookmark by PDBookmarkGetFirstChild(Root) and get the reference of newly added bookmark. Now Unlink the reference of new bookmark and place is as PDBookmarkAddPrev(firstChild).
PDBookmark newBookmark = PDBookmarkAddNewChild (Root, "Untitled");
PDBookmark firstChild = PDBookmarkGetFirstChild(Root);
In this case, the result is little different. After doing this operation the bookmark won't appear. If I save the file and reopen it again then every thing is fine and bookmark, that I added at the first position, is present at the first position. In this case, what I think, the problem is more related to refreshing of bookmark pane (list). Any Comments ?
- Following the same steps in first strategy except adding at previous position, I add at the next position of the first bookmark. Adding bookmark at the next position shows up immediately. I tries to swap the contents of the first two bookmarks. Everything works fine in this case. The only problem occurs is that when we have two titles of different length ( "Abc" and "efghijkl" ). Upon swapping the contents, bookmark actions swapped successfully but the bookmark at the first place become "efg", which should be "efghijkl" and bookmark at second place become "Abc" which is correct. The title that is smaller won't get effected but the title of larger length got truncated upto the length of smaller title. Any comments ??
Waiting for your reply,