Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old October 25th, 2011, 02:01 PM
kwinsley kwinsley is offline
Junior Community Member
 
Join Date: Sep 2008
Location: Ohio
Posts: 10
Default OnRecordStart - turn off PDF pages.

Hi all,

Here's an OnRecordStart question. We have a twenty page PDF that is to represent 10 2-sided signs. That is, page 1 and page 2 are the first sign, front and back. Page 3 and 4 are sign 2, etc.

Based upon the field "Version Text 1" through "..10" we want the user to be able to turn on and off pages. I had it working when I was only turning off one page per variable field, but I can't get it to work to turn off two pages. This is where I'm at right now:

Code:
if (Field("Version Text 1") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body1",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body1",false);
 
if (Field("Version Text 1") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body2",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body2",false);
 
if (Field("Version Text 2") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body3",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body3",false);
 
if (Field("Version Text 2") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body4",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body4",false);
 
if (Field("Version Text 3") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body5",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body5",false);
 
if (Field("Version Text 3") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body6",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body6",false);
 
if (Field("Version Text 4") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body7",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body7",false);
 
if (Field("Version Text 4") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body8",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body8",false);
 
if (Field("Version Text 5") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body9",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body9",false);
 
if (Field("Version Text 5") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body10",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body10",false);
 
if (Field("Version Text 6") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body11",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body11",false);
 
if (Field("Version Text 6") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body12",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body12",false);
 
if (Field("Version Text 7") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body13",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body13",false);
 
if (Field("Version Text 7") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body14",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body14",false);
 
if (Field("Version Text 8") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body15",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body15",false);
 
if (Field("Version Text 8") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body16",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body16",false);
 
if (Field("Version Text 9") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body17",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body17",false);
 
if (Field("Version Text 9") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body18",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body18",false);
 
if (Field("Version Text 10") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body19",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body19",false);
 
if (Field("Version Text 10") == "Y")
    FusionPro.Composition.SetBodyPageUsage("Body20",true);
else
    FusionPro.Composition.SetBodyPageUsage("Body20",false);
Where is the code wrong, and is there an easier way to do this?

I'm building it in Acrobat 9.0.0 / FP 7.1P1c on a Windows 7 machine.


Thanks all!
Reply With Quote
 

Tags
onrecordstart

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:23 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.