Bookmarks in PDF

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Bookmarks in PDF

Postby IDEAL Software Support » Tue Nov 23, 2004 4:42 pm

Hi *,

when building VPE pages it is possible to add Bookmarks to the
current page like this:

LOCAL nParentBookmark AS DWORD
// print the page
odcVPEngine:AddBookmark( nParentBookmark , "Bookmarktext" )
.
.
.
this works fine, but when first building all pages collect the
bookmarkdata for each page in a array during this step
and then use odcVPEngine:currentpage for each page/bookmark
the bookmarks will not appear in it´s parent, they all come
down as each parent would by 0.
it should be possible to build all pages needed, then sort my
array data for bookmarks, and then goto each page and set the
bookmark ?

ntotal := Len( _aKatalogGruppen )
IF ntotal > 0
ASort( _aKatalogGruppen,,, {|x, y| x[1] <= y[1]})
nParentBookmark2 := odcVPEngine:AddBookmark(0, "Artikel-Gruppen")
FOR noft := 1 UPTO ntotal
odcVPEngine:currentpage := pagenum
cString := AllTrim(_aKatalogGruppen[noft,1])
odcVPEngine:AddBookmark( nParentBookmark2 , cString )
NEXT noft
ENDIF

Ecki
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Postby IDEAL Software Support » Tue Nov 23, 2004 4:43 pm

Your code is wrong.

The call to

nParentBookmark2 := odcVPEngine:AddBookmark(0, "Artikel-Gruppen")
is done on the last page.

This is not a problem for VPE, but for Acrobat Reader. It requires parent bookmarks to be placed on a page equal or prior to the page where the first child-bookmark is placed.

Solution:
Set CurrentPage = <page number of first child bookmark>
then add your child bookmarks

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 34 guests