Do you have a Body-Page called "Track&Field"?
Are you creating these cards in your template? Or just reading in previously
created cards as pdf graphic files where sometimes there is only 1 page and
some times there are two pages and then imposing it or something?
Either way, there are options you can do.
1) If you need to test for the existence of a specific page in a pdf file, in
an OnRecordStart rule set the second Body-Page (I'll call it "backPage") to a
default of unused, then use this rule in OnRecordStart...
var r = new FusionProResource("enter the path and card name here");
r.pagenumber = X;
if (r.exists) {
FusionPro.Composition.SetBodyPageUsage("backPage",true);
}
...
This rule will look at the pdf file that you entered in as the variable "r",
and check for a page number you enter for X. If one exists then it will
activate the unused template page "backPage" for this record/card. It is does
not exist, then the "backPage" will remain unused and not be available in this
template.
2) If your template is "creating the cards" and you need to turn on a second
page depending upon which department this person is within, then you could do a
similar OnRecordStart rule to turn on specific "unused" pages within your
template. This is helpful when the "marketing department" has a totally
different layout look than your "sales department" - even when the look of the
entire card is different for both front and back. First, if you have a common
front layout leave that one set as a normal Body-Page and in your OnRecordStart
rule check for a department code or something to tell you if there is a second
side or not.
if (Field("department") == "marketing") {
FusionPro.Composition.SetBodyPageUsage("marketingBackPage",true);
}
else if (Field("department") == "sales") {
FusionPro.Composition.SetBodyPageUsage("salesBackPage",true);
}
This rule will turn on unused Body-Pages in your template called
marketingBackPage or salesBackPage only when the department variable equals
those values. If any other value is in that field (or blank), then those pages
are left unused.
3) If the person is going to be entering their department name from say a
pull-down list, and you want to be able to turn on a back side if it exists via
a case statement as in your example, then you would need a listing of your
template pages in your case statement that include all possibilities of
template back pages, so your designation of
"FusionPro.Composition.SetBodyPageUsage(Field("Department"),true);" would only
work if there was a page named EXACTLY as in the field "Department". If there
wasn't, the yes the program will give an error since it can't find one. Alter
your case statement to be a little more specific in it checking list..
switch (Field("Back")) {
case "Option A - Blue":
FusionPro.Composition.SetBodyPageUsage("Option A",true);
case "Option B - White":
FusionPro.Composition.SetBodyPageUsage("Option B",true);
case "marketing":
FusionPro.Composition.SetBodyPageUsage(Field("marketing",true);
case "sales":
FusionPro.Composition.SetBodyPageUsage(Field("sales",true);
case "corporate":
FusionPro.Composition.SetBodyPageUsage(Field("corporate",true);
case "it":
FusionPro.Composition.SetBodyPageUsage(Field("it",true);
}
Your case statement should list any and all possibilities, and not be too
generic
---
David A. Sweet
Web Designer/Graphic Designer
HKM Direct Market Communications
A DirectConnectGroup Company
-----Original Message-----
From: Craig Daters [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2008 10:35 AM
To: FusionPro Users Forum
Subject: [fusionpro] Question re: BodyPage "Exists" logic
Working with a organization that has many departments, but not all of them
have a second side option for this particular business card.
I have the following "OnRecordStart" rule:
switch (Field("Back")) {
case "Option A - Blue":
FusionPro.Composition.SetBodyPageUsage("Option A",true);
case "Option B - White":
FusionPro.Composition.SetBodyPageUsage("Option B",true);
case "Department":
FusionPro.Composition.SetBodyPageUsage(Field("Department"),true);
}
I am getting an error for those departments for which I do not have a second
BodyPage:
Job started 07:21:24 - 1206627684.
OnRecordStart, line 7: Error: In SetBodyPageUsage(), no page named "Track &
Field"
Begun composing record #1
Job ended 07:21:25 - 1206627685.
What would be the best way to adjust my logic to accommodate scenarios where
that department does not have a BodyPage and not generate an error
condition?
I guess I am looking for logic which tests whether or not a BodyPage exists,
and if it does, then "turn it on", if not "return" kind of thing.
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.1/1345 - Release Date: 3/26/2008 6:50
PM
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
FusionPro 5.0 Now Available!
Variable text on a curve and soft drop-shadows for variable text
LIMITED TIME upgrade offer of $299 per license for current customers:
http://fusionpro.printable.com/store/upgrade
New licenses available for $599 each at:
http://fusionpro.printable.com/store/
All FusionPro 5.0 customers to receive FusionPro 5.1 with
Adobe Acrobat 8 and InDesign CS3 support when released for FREE.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
--
Users of FusionPro Desktop have unlimited free email support. Contact Printable
Support at [EMAIL PROTECTED]
--
View FusionPro Knowledge Base, FusionPro Samples at
www.printable.com/vdp/desktop.htm
--
You are currently subscribed to fusionpro as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
--
--
Note: All e-mail sent to or from this address will be received or otherwise
recorded by the e-mail recipients of this forum. It is subject to archival,
monitoring or review by, and/or disclosure to someone other than the recipient.
Our privacy policy is posted on www.printplanet.com
--