MarcomCentral (PTI) and FusionPro User Communities

MarcomCentral (PTI) and FusionPro User Communities (http://forums.pti.com/index.php)
-   The JavaScript Library (http://forums.pti.com/forumdisplay.php?f=23)
-   -   Connecting graphic frames (http://forums.pti.com/showthread.php?t=5413)

Christian Johnson October 25th, 2019 10:36 AM

Connecting graphic frames
 
I'm trying to create a rule that allows a customer to upload a 2 page PDF and have the second page of the uploaded PDF flow to the second page of my template. I've been in constant contact with support on this and seem to hit a wall.

My Rule:

var pathName = "..\\RESOURCES\\";
var FullResourcePath = pathName + "<graphic file=" + Field("Cover") + ".pdf">;
var x = new FusionProResource(FullResourcePath, "graphic", 1);
if (!x.exists)
ReportError("Graphic not found: " + FullResourcePath);
var pdfString = '';
for (var pgnbr = 1; pgnbr <= x.countPages; pgnbr++)
{
x.pagenumber = pgnbr;
pdfString += x.value + '<p>\n';
}
Print("Result is: " + pdfString);
return pdfString;

Please note on this rule I do get a syntax error

Any help on this is greatly appreciated.

Dan Korn October 25th, 2019 01:29 PM

Re: Connecting graphic frames
 
Quote:

Originally Posted by Christian Johnson (Post 22091)
I'm trying to create a rule that allows a customer to upload a 2 page PDF and have the second page of the uploaded PDF flow to the second page of my template. I've been in constant contact with support on this and seem to hit a wall.

You don't connect Graphic Frames. This rule creates a series of inline graphics, which go into Text Frames. You need to make this a Text rule, and insert the rule's name as a variable into a Text Frame. Then, you would typically set up Overflow pages to flow into.
Quote:

Originally Posted by Christian Johnson (Post 22091)
Please note on this rule I do get a syntax error

You need to put the last tag closing marker > inside the quotes at the end of line 2, just before the ending semicolon:
Code:

var FullResourcePath = pathName + "<graphic file=" + Field("Cover") + ".pdf>";


All times are GMT -7. The time now is 04:59 PM.

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