Donnez vie à vos documents numériques !
 

Répondre à : Logo variable en fonction du choix dans liste déroulante

abracadabraPDF Forums PDF – Général Logo variable en fonction du choix dans liste déroulante Répondre à : Logo variable en fonction du choix dans liste déroulante

#56760
Merlin
Maître des clés

Bonjour et bienvenue,

J’ai trouvé ça dans la doc. JavaScript, c’est une autre méthode :

Example:
This example takes every named icon in the document and creates a list box using the names. Selecting an
item in the list box sets the icon with that name as the button face of the field “myPictures”. What follows is
the mouse-up action of the button field “myButton”.

Code:
[font=courier]var f = this.getField(« myButton »)
var aRect = f.rect;
aRect[0] = f.rect[2]; // Place list box relative to the
aRect[2] = f.rect[2] + 144; // position of « myButton »
var myIcons = new Array();
var l = addField(« myIconList », « combobox », 0, aRect);
l.textSize = 14;
l.strokeColor = color.black;
for (var i = 0; i < this.icons.length; i++)
myIcons = this.icons.name;
l.setItems(myIcons);
l.setAction(« Keystroke »,
‘if (!event.willCommit) {rt’
+ ‘var f = this.getField(« myPictures »);rt’
+ ‘var i = this.getIcon(event.change);rt’
+ ‘f.buttonSetIcon(i);r’
+ ‘}’);
[/font]

The named icons themselves can be imported into the document through an interactive scheme, such as
the example given in addIcon or through a batch sequence.
See also buttonGetCaption for a more extensive example.

Sinon, pour qu’on puisse t’aider plus il faudrait que tu postes une maquette de ton document.
:Smiley15: