On May 9, 2007, at 7:53 AM, Dan Parisen wrote:
After creating this in "Edit rules" when I click "validate" I get the
multicolored spinning wheel and it jams up acrobat so I have to
force quit.
What element in this rule is making acrobat think so hard?
You have what's called an infinite loop. You set the pgnbr variable
to 1, then you loop as long as it's less than 10. But the counter is
never incremented, so it's always less than ten, so the loop repeats
forever. Try adding this at the end of the "while" block, before the
last closing curly brace:
pgnbr++;
(This was why I replaced the "while" loop with a "for" loop in my
version, because in a "for" loop it's more obvious where the counter
variable is being incremented.)
That said, FusionPro is supposed to detect when a loop is endlessly
repeating like this and give an error instead of simply being stuck
forever. This doesn't seem to be working in this case, though. I'll
have to investigate why.
var x = new FusionProResource(pathName + "MyFile.pdf", "graphic");
var pdfString = '';
for (var pgnbr = 1; pgnbr <= x.countPages; pgnbr++)
{
x.pagenumber = pgnbr;
pdfString += x.content;
}
return pdfString;
The first time I did this the return that I got was the word
"undefined"
repeated as many times as there were pages in the pdf that I was
referencing
(tried two different files).
Sorry about that. If you're using FusionPro 3.2, you need to use the
FusionProResource.value property. So change that last line in the
"for" block to:
pdfString += x.value;
In version 4.0 and later, the .value property will still work, but I
recommend using the new FusionProResource.content property, which
also works with text resources, instead.
Also when I composed I got this error message
"Check for file existence and that it is of proper format".
Well, the file has to exist at the specified path, or relative to
your job folder. Are you setting the "pathName" variable somewhere?
Try adding something like this to your rule, right after you create
the FusionProResource object, and it should help you to figure out
what's wrong:
if (!x.valid)
return "Resource not found: " + x.name;
Dan
--
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
--