Donnez vie à vos documents numériques !
 

Répondre à : Menu création signet. – RÉSOLU

abracadabraPDF Forums PDF – Général Menu création signet. – RÉSOLU Répondre à : Menu création signet. – RÉSOLU

#52532
Stubiana
Membre

Bonjour bebarth,

La fonction createChild peut prendre 3 paramètres

Copier/coller de la doc JS :

cName
The name of the bookmark that the user sees in the navigation panel.

cExpr
(optional) An expression to be evaluated whenever the user clicks the bookmark. It is equivalent to creating a bookmark with a JavaScript action, as described in the PDF Reference version 1.7. The default is no expression.

nIndex
(optional) The 0-based index into the children array of the bookmark at which to create the new child. The default is 0.

Le 3eme paramètre, nIndex, détermine la position du signet par rapport à son parent, il te suffit donc de mettre en paramètre le nombre de signets de ton document, et il sera placé en dernière position.

Ce qui donne:
this.bookmarkRoot.createChild(« Dernière page », «  », this.bookmarkRoot.children.length);

Cordialement.  :bonjour: