Hey all, thank you for your suggestions, I will analyze these for future
usage. This is indeed for FPW, but I posted to both forums as I felt it was
something that either venue might be able to solve despite their differences
(although I know I would have more options if this was being built in-house
versus coming off the web).
Prior to these emails, I believe that I have previously solved my problem
with the following code (though I was hoping for a simple method of checking
for the existence of a BodyPage/Name in the PDF and developing logic around
it):
if (Field("Back") != "") {
if (Field("Back") == "Option A - Blue")
FusionPro.Composition.SetBodyPageUsage("Option A",true);
else if (Field("Back") == "Option B - White")
FusionPro.Composition.SetBodyPageUsage("Option B",true);
else if (Field("Back") == "Department") {
var dept=new Array(8);
dept[0] = "Basketball";
dept[1] = "Softball";
dept[2] = "Soccer";
dept[3] = "Gymnastics";
dept[4] = "Women's Golf";
dept[5] = "Women's Basketball";
dept[6] = "Baseball";
dept[7] = "Volleyball";
for (x=0;x<=8;x++)
{
if (Field("Department") == dept[x])
FusionPro.Composition.SetBodyPageUsage(Field("Department"),true);
}
}
}
I always try to simplify as much as I can (...know how to do...), thus the:
FusionPro.Composition.SetBodyPageUsage(Field("Department"),true);
Thanks again,
Craig D.
-----Original Message-----
From: Raul Ruiz [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2008 10:25 AM
To: Web To Print Users Forum
Subject: [pti_web_to_print] RE: Question re: BodyPage "Exists" logic
Why don't you just create a CreateResource variable and then use that to
both insert your appropriate graphic in a graphic rule and also check the
file's existence in an OnRecordStart rule. The OnRecordStart would allow you
to say something generic like the following;
ImagePath = "ImagePathGoesHere";//you might not need this if you are using
FP Web
var b = CreateResource(ImagePath + Field("Department") + ".eps", "graphic",
true);
if (Field("Back") == "Option A-Blue")
{
FusionPro.Composition.SetBodyPageUsage("Option A",true);
}
if (Field("Back") == "Option B-White")
{
FusionPro.Composition.SetBodyPageUsage("Option B",true);
}
if (Field("Back") == "Department" && b.exists)
{
FusionPro.Composition.SetBodyPageUsage(Field("Department"),true);
}
David's method is similar except I gather you are using FPW and you might
not need a relative file path as the mapped libraries take care of that as
long as you map two or three images.
HTH
-----Original Message-----
From: David Sweet [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2008 8:48 AM
To: FusionPro Users Forum
Subject: [fusionpro] RE: Question re: BodyPage "Exists" logic
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
--
No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.1/1345 - Release Date: 3/26/2008
6:50 PM
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
--
Please note: It is the policy of West Press that all e-mail
sent to and from any @westpress.com address may be recorded
and monitored. Unless it is West Press related business,
please do not send any material of a private, personal,
or confidential nature to this or any @westpress.com
e-mail address.
This message has been scanned for UCE (spam), viruses,
and dangerous content, and is believed to be clean
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
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
--