#1
|
||||
|
||||
![]()
Is there a way to pull random static pages.
I have a layout with 50 pages and pages named 1 to 50 in the "Page Usage" Everyone gets Page1 & 2 then it's random and everyone gets the last 2 pages 49 & 50. Static Pages 3 to 48 can be in any order like P3, 4, 5 or P4, 3, 47, 11, 5 I can have a data file created and populated with the pages that need to be pulled. Field called "VarPages" How do I do this in "OnRecordStart" Hope this is clear enough.
__________________
Kal Bedi FusionPro Desktop 10.1.9 Adobe Acrobat Pro DC Mac OS Sierra 10.12.5 Canada |
#2
|
||||
|
||||
![]()
You can't re-order pages in your template from OnRecordStart – you can only turn them on/off. Is that a requirement? If so, I would suggest having a 5 page template with pages 1, 2, 4, and 5 as static pages that always return pages 1, 2, 49 and 50 (respectively) and the 3rd page being an overflow page that adds a random number of pages, each pulling a different random page from the other 46 pages:
Code:
var pdf = CreateResource('path/to/your.pdf', 'graphic'); var pages = []; for (var i=2; i<49; i++) pages.push(i); return pages .sort(function(){ return .5 - Math.random(); }) .splice(0, Math.floor((Math.random() * pages.length) + 1)) .map(function(s){ pdf.pagenumber = s; return pdf.content; }) .join('<p>'); Code:
for (var i=2; i<49; i++) if (Math.round(Math.random())) FusionPro.Composition.SetBodyPageUsage(i, true);
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
#3
|
||||
|
||||
![]()
Thanks Ste, I'll give that a try.
__________________
Kal Bedi FusionPro Desktop 10.1.9 Adobe Acrobat Pro DC Mac OS Sierra 10.12.5 Canada |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|