Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Adding and deleting pages using a checkbox

$
0
0

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


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>