Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Jeremy Cornwell
11,106 PointsHow to import pictures in a dialogue box in a dynamic stamp
Within Adobe Acrobat, I have a dialogue box created that has text fields and check boxes currently. I want to add the ability to import a pdf/image file and am at a loss for how to do it. I've come across event.target.buttonImportIcon(); but I am not sure how to use it. The following is my code I have thus far. Hopefully this makes sense.
// Dialog Definition
var oDlg = {
commit: function(dialog) {
var data = dialog.store();
this.pNumber = data[ "pnum"];
this.sNumber = data[ "snum"];
var oRslt = dialog.store();
this.approved = oRslt["capp"];
this.furnish = oRslt["cfur"];
this.revise = oRslt["crev"];
this.rejected = oRslt["crej"];
this.image = oRslt["imag"]; //Was going to use this for the image?
},
description: {
name: "Test Dialog", elements: [ {
type: "view", elements: [
{
name: "Enter the Project Number:",
type: "static_text",
},
{
item_id: "pnum",
type: "edit_text",
char_width: 15
},
{
name: "Enter the Submittal Number:",
type: "static_text",
},
{
item_id: "snum",
type: "edit_text",
char_width: 15
},
{
type: "check_box",
item_id: "capp",
name: "Approved",
width: 102,
height: 23,
},
{
type: "check_box",
item_id: "cfur",
name: "Furnish as Corrected",
width: 102,
height: 23,
},
{
type: "check_box",
item_id: "crev",
name: "Revise and Resubmit",
width: 102,
height: 23,
},
{
type: "check_box",
item_id: "crej",
name: "Rejected",
width: 102,
height: 23,
},
{ type: "ok_cancel", },
]
},]
}
};
// Dialog Activation
if( "ok" == app.execDialog(oDlg)) {
getField("ProjectNumber").value = oDlg.pNumber;
getField("SubmittalNumber").value = oDlg.sNumber;
getField("approved").value = oDlg.approved;
getField("furnish").value = oDlg.furnish;
getField("revise").value = oDlg.revise;
getField("rejected").value = oDlg.rejected;
getField("image").value = oDlg.image;
}