5 Replies Latest reply on Aug 2, 2014 10:38 AM by gkaiseril

    Adding and deleting pages using a checkbox

    Duquette Level 1

      I am trying to delete a page and then add two pages to a pdf form if a checkbox is checked.  It doesn't work and I dont have a clue why not. Help Please!

       

      // If Checkbox is checked Code will delete page 5 and Insert The Analyzer Log for Page 5 and the H2S Analyaer Report for Page 7.

       

      var c = getField("ANA").value;

      if (c==="Yes")

            this.deletePages ({

                                               nStart: 5,

                                               nEnd:  5

                                          }) ;

       

      var InsertNewPage = app.trustedFunction( function(cPath)

         {

       

        app.beginPriv();

       

        this.insertPages ({

                                                    nPage: -1,

                                                    cPath: "/C/Adobe Test/Analyzer Log.pdf",

                                                    nStart: 5,

                                                    nEnd: 5

                                                                      });

         this.insertPages  ({

                                                       nPage: -1,

                                                       cPath: "/C/Adobe Test/Analyzer Report.pdf",

                                                       nStart: 7,

                                                       nEnd: 7

                                                                     });

      app.endPriv();

        });

       

      //END CODE