View Single Post
  #2  
Old March 7th, 2017, 09:31 AM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 957
Default Re: Setting pages to unused

One way to do that is to add this to your OnRecordStart callback rule:
Code:
// List of pages that should be enabled in your template
var enabledPages = [
  4,
  10,
  11,
];
var totalPages = 1000; // Total number of pages in your template
for (var page = 1; page <= totalPages; page++) {
  FusionPro.Composition.SetBodyPageUsage(page, enabledPages.indexOf(page) > -1);
}
You can also get away with not defining the total number of pages in your document by using this code instead:
Code:
// List of pages that should be enabled in your template
var enabledPages = [
  4,
  10,
  11,
];

var page = 0;
while (++page && !FusionPro.inValidation) {
  try {
    FusionPro.Composition.SetBodyPageUsage(page, enabledPages.indexOf(page) > -1);
  } catch(e) { break; }
}
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn

Last edited by step; March 7th, 2017 at 09:31 AM.. Reason: Forgot to define a variable
Reply With Quote