two actions in one marker

Explorer ,
Aug 29, 2018

Copy link to clipboard

Copied

hello a query, I have a bookmark which I want to have two actions, the first would be an alert and the other to open a file .....

Can it be done using javascript? to save time

TOPICS
Acrobat SDK and JavaScript

Views

165

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

two actions in one marker

Explorer ,
Aug 29, 2018

Copy link to clipboard

Copied

hello a query, I have a bookmark which I want to have two actions, the first would be an alert and the other to open a file .....

Can it be done using javascript? to save time

TOPICS
Acrobat SDK and JavaScript

Views

166

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 29, 2018 0
Most Valuable Participant ,
Aug 29, 2018

Copy link to clipboard

Copied

JavaScript can only create JS-based actions, and only one of them.

You can do both things in a single JS-action, though.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 29, 2018 0
Explorer ,
Aug 29, 2018

Copy link to clipboard

Copied

to ok where can i look for information to do that

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 29, 2018 0
Most Valuable Participant ,
Aug 29, 2018

Copy link to clipboard

Copied

This forum is an excellent resource... Try searching it for relevant keywords.

Also, see: Adobe - Acrobat Developer Center | Adobe Developer Connection

And: https://acrobatusers.com/tutorials/

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 29, 2018 0
Explorer ,
Aug 29, 2018

Copy link to clipboard

Copied

var CustomAlert =

{

    result:"cancel",

    DoDialog: function(){return app.execDialog(this);},

    initialize: function(dialog)

    {

        var dlgInit =

        {

            "img2":

                {

                    "width":100,

                    "height":33,

                    offset: 0,

                    "read": function(bytes){return asdf.slice(this.offset,this.offset+=bytes);}

                },

            "stat": "Usted esta por abrir un archivo que fue firmado digitalmente por el GCBA\nEl cual contiene un archivo adjunto con el libro de sueldo correspondiente",

        };

        dialog.load(dlgInit);

    },

    commit: function(dialog)

    {

        var oRslt = dialog.store();

    },

      mylk:function(dialog){ app.launchURL("www.infobae.com.ar");},

    description:

    {

        name: "Custom Alert",

        elements:

        [

            {

                type: "view",

                elements:

                [

                    {

                        type: "view",

                        align_children: "align_top",

                        elements:

                        [

                            {

                                type: "image",

                                item_id: "img2",

                                width: 100,

                                height: 33,

                                char_width: 4,

                                char_height: 4,

                            },

                            {

                                type: "static_text",

                                item_id: "stat",

                                width: 220,

                                height: 64,

                                alignment: "align_fill",

                                font: "dialog",

                                bold:"true"

                            },

                        ]

                    },

                    {

                        type:"button",

                        item_id:"mylk",

                        name:"WWWW.infobae.com.ar",

                        },

                        {

                            type: "ok",

                            ok_name: "Continue",

                        },

                ]

            },

        ]

    }

};

// Example Code

if("ok" == CustomAlert.DoDialog())

{

}

this is the code I have for the alert, how can I make the accept button open a pdf file?

so I do not have to create two actions, so I have

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 29, 2018 0
Most Valuable Participant ,
Aug 29, 2018

Copy link to clipboard

Copied

if ("ok" == CustomAlert.DoDialog()) {

     app.openDoc("/C/Temp/SomeFile.pdf"); 

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 29, 2018 0
Explorer ,
Aug 29, 2018

Copy link to clipboard

Copied

ok muchas gracias

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 29, 2018 0
DEM1 LATEST
Explorer ,
Aug 29, 2018

Copy link to clipboard

Copied

ok muchas gracias

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 29, 2018 0