#1
|
|||
|
|||
![]()
Hello, our customer will be providing a document to use that may contain 100's or 1000's of pages. The job will require that only select pages as well as a separate variable page will be used for each record. Is there a way to quickly set all of the pages to unused? I certainly will not want to go mark every page as unused manually. Thanks!
|
#2
|
||||
|
||||
![]()
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); } 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 Last edited by step; March 7th, 2017 at 09:31 AM.. Reason: Forgot to define a variable |
#3
|
|||
|
|||
![]()
Step, thank you for that response. That sets me off in the right direction. I did run into one problem however.
The enabledPages variable that is being set at the beginning does not seem to want to take in the field. for example, I was looking to do something like this: enabledPages = [field("record number"), 101] So that page "record number" (maybe equals 1) would be the valid page for that record as well as page 101. The next record in the document might end up calling out page 5 and so on. I hope that makes sense. |
#4
|
||||
|
||||
![]() Quote:
Quote:
Code:
// List of pages that should be enabled in your template var enabledPages = [Field("record number"), 101].map(Int); 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 |
#5
|
|||
|
|||
![]()
Step, the .map(Int) part is all that I needed. The job works now. Thanks!!
|
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|