#1
|
|||
|
|||
![]()
I have 4 versions of a postcard. I have the version in my list to state which version to use. I have all 4 version in one PDF and have named pages 1 and 2 as body and 3-8 as unused. When I compose the file, it uses the default pages of 1 and 2 or the last 2 pages 7 and 8. For the versions that should be using pages 3-6, it is using pages 1 and 2. My script looks as follows:
if (Field("version") == "CORALVILLE") { FusionPro.Composition.SetBodyPageUsage("Coralville 1", true) FusionPro.Composition.SetBodyPageUsage("CedarRapid s1", false) FusionPro.Composition.SetBodyPageUsage("Coralville 2", true) FusionPro.Composition.SetBodyPageUsage("CedarRapid s2", false) } else { FusionPro.Composition.SetBodyPageUsage("Coralville 1", false) FusionPro.Composition.SetBodyPageUsage("CedarRapid s1", true) FusionPro.Composition.SetBodyPageUsage("Coralville 2", false) FusionPro.Composition.SetBodyPageUsage("CedarRapid s2", true) } if (Field("version") == "NORTHLIBERTY") { FusionPro.Composition.SetBodyPageUsage("NorthLiber ty1", true) FusionPro.Composition.SetBodyPageUsage("CedarRapid s1", false) FusionPro.Composition.SetBodyPageUsage("NorthLiber ty2", true) FusionPro.Composition.SetBodyPageUsage("CedarRapid s2", false) } else { FusionPro.Composition.SetBodyPageUsage("NorthLiber ty1", false) FusionPro.Composition.SetBodyPageUsage("CedarRapid s1", true) FusionPro.Composition.SetBodyPageUsage("NorthLiber ty2", false) FusionPro.Composition.SetBodyPageUsage("CedarRapid s2", true) } if (Field("version") == "WASHINGTON") { FusionPro.Composition.SetBodyPageUsage("Washington 1", true) FusionPro.Composition.SetBodyPageUsage("CedarRapid s1", false) FusionPro.Composition.SetBodyPageUsage("Washington 2", true) FusionPro.Composition.SetBodyPageUsage("CedarRapid s2", false) } else { FusionPro.Composition.SetBodyPageUsage("Washington 1", false) FusionPro.Composition.SetBodyPageUsage("CedarRapid s1", true) FusionPro.Composition.SetBodyPageUsage("Washington 2", false) FusionPro.Composition.SetBodyPageUsage("CedarRapid s2", true) } return ""; I have had this work when just switching out one page, but have never tried with multiple pages. Any help would be appreciated. |
#2
|
|||
|
|||
![]()
In Manage Pages > Page Usage - all pages should be set to unused.
Your Bodypages should be named according to "body page" Using your example CORALVILLE has a front body page named "Coralville 1" and back "Coralville 2"- I am assuming this is the front and back. do similar for other 3 cards. If you don't set your body pages to unused they will print/process. in your OnRecordStart callback rule Code:
if (Field("version") == "CORALVILLE") { FusionPro.Composition.SetBodyPageUsage("Coralville 1", true) FusionPro.Composition.SetBodyPageUsage("Coralville 2", true) } else if (Field("version") == "NORTHLIBERTY") { FusionPro.Composition.SetBodyPageUsage("NorthLiberty 1", true) FusionPro.Composition.SetBodyPageUsage("NorthLiberty 2", true) } else if (Field("version") == "WASHINGTON") { FusionPro.Composition.SetBodyPageUsage("Washington 1", true) FusionPro.Composition.SetBodyPageUsage("Washington 2", true) } else if (Field("version") == "CedarRapid") { FusionPro.Composition.SetBodyPageUsage("CedarRapids 1", true) FusionPro.Composition.SetBodyPageUsage("CedarRapids 2", true) }
__________________
Leo Smith - Novice FusionPro VDP Creator 10 Adobe Pro CC Windows 7 Last edited by Leosmith; February 22nd, 2018 at 03:17 PM.. Reason: took out space in NorthLiberty - and CedarRapids...? |
#3
|
||||
|
||||
![]() Quote:
Let's assume, for example, the value of the 'version' field is 'CORALVILLE': Code:
if (Field("version") == "CORALVILLE") // TRUE { FusionPro.Composition.SetBodyPageUsage("Coralville 1", true) // This page is enabled FusionPro.Composition.SetBodyPageUsage("CedarRapid s1", false) // This page is disabled FusionPro.Composition.SetBodyPageUsage("Coralville 2", true) // This page is enabled FusionPro.Composition.SetBodyPageUsage("CedarRapid s2", false) // This page id disabled } else { // --------------------- FusionPro.Composition.SetBodyPageUsage("Coralville 1", false) // Since the first condition FusionPro.Composition.SetBodyPageUsage("CedarRapid s1", true) // was met, this else block FusionPro.Composition.SetBodyPageUsage("Coralville 2", false) // does not execute. FusionPro.Composition.SetBodyPageUsage("CedarRapid s2", true) // ----------------------- } if (Field("version") == "NORTHLIBERTY") // FALSE { FusionPro.Composition.SetBodyPageUsage("NorthLiber ty1", true) // ------------------------ FusionPro.Composition.SetBodyPageUsage("CedarRapid s1", false) // Since version is not NORTHLIBERTY FusionPro.Composition.SetBodyPageUsage("NorthLiber ty2", true) // this does not execute. FusionPro.Composition.SetBodyPageUsage("CedarRapid s2", false) // ------------------------ } else { FusionPro.Composition.SetBodyPageUsage("NorthLiber ty1", false) // This page is disabled FusionPro.Composition.SetBodyPageUsage("CedarRapid s1", true) // This page is enabled FusionPro.Composition.SetBodyPageUsage("NorthLiber ty2", false) // This page is disabled FusionPro.Composition.SetBodyPageUsage("CedarRapid s2", true) // This page is enabled } if (Field("version") == "WASHINGTON") // FALSE { FusionPro.Composition.SetBodyPageUsage("Washington 1", true) // ------------------------- FusionPro.Composition.SetBodyPageUsage("CedarRapid s1", false) // Since version is not WASHINGTON FusionPro.Composition.SetBodyPageUsage("Washington 2", true) // this does not execute. FusionPro.Composition.SetBodyPageUsage("CedarRapid s2", false) // ------------------------- } else { FusionPro.Composition.SetBodyPageUsage("Washington 1", false) // This page is disabled FusionPro.Composition.SetBodyPageUsage("CedarRapid s1", true) // This page is enabled FusionPro.Composition.SetBodyPageUsage("Washington 2", false) // This page is disabled FusionPro.Composition.SetBodyPageUsage("CedarRapid s2", true) // This page is enabled } return ""; You could simplify things a lot by replacing all of that code with: Code:
var pages = ['Coralville', 'CedarRapids', 'NorthLiberty', 'Washington']; var version = Field("version"); for (var i in pages) { var page = pages[i]; var enable = new RegExp(page, 'i').test(version); FusionPro.Composition.SetBodyPageUsage(page + '1', enable); FusionPro.Composition.SetBodyPageUsage(page + '2', enable); }
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
#4
|
|||
|
|||
![]()
Thank you very much for your help. Worked like a charm.
|
#5
|
|||
|
|||
![]()
I know I'm late to the party, but thought I would still share too.
When I have a job that has multiple pages, front and back for specific versions in one file. I set all the pages to be unused, and then I name the what ever they are called in the data file (usually called 'Key Code' field) with either '_Front' or '_Back' depending on what they are. Then I use this code as an OnRecordStart-BodyPageUsage Rule: Code:
FusionPro.Composition.SetBodyPageUsage(Field("Key Code")+"_Front", true); FusionPro.Composition.SetBodyPageUsage(Field("Key Code")+"_Back", true); You can change the '_Front' and '_Back' to whatever you want, you just need to be consistent for all your pages. |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|