Quantcast
Channel: Adobe Community: Message List - PDF Forms
Viewing all articles
Browse latest Browse all 57214

Re: Duplicate pages without duplicating forms

$
0
0

I had a look at the Acrobat SDK help files and got the information below.

 

What you describe can be achieved by using Templates, but I am not sure if it is possible if your users have only Acrobat Reader.

 

Due to security restrictions, the following script works only in the JavaScript console or as part of a Batch sequence. You won't be able to put it into a button.

 

     //Put this into the Console or in a Batch command
     //Create a template based on the first page of the PDF - edit the nPage number to suit your PDF         

     this.createTemplate({cName: "myTemplate", nPage: 0});   

     var myTemplateArray = this.templates;
     var myTemplate = myTemplateArray[0];
     myTemplate.spawn(this.numPages, false, false);

 

     // Obtain the collection of templates:

     var t = this.templates;
     var T = t[0];

 

     // Prevent file size inflation by using the XObject.

     var XO = T.spawn(0, true, true);
     for (var i = 1; i < 3; i++)     //Duplicates the page twice - edit the number to suit your needs
     T.spawn(i, true, true, XO);

 

 

The example above creates 2 additional pages based on the first page of the form. The field names on each page will be unique.

 

You can read more about templates at:

http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_Dev_T emplates.80.2.html

 

I hope this helps.


Viewing all articles
Browse latest Browse all 57214

Trending Articles



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