Jump to content

returning 2 page pdf (front and back)


Recommended Posts

I have ~50 two page pdf's, each is for basically a different state. I want it to return the front page of the pdf based off the drop down in marcom and then the back side of the pdf on page two. A current template we have returns the first page:

 

result = "";

 

if (Field("State") != "")

{

var Pic = new FusionProResource(Field("State"), "graphic", "true");

for (Pic.pagenumber = 1; Pic.pagenumber <= Pic.countPages; Pic.pagenumber++)

if (Pic.pagenumber == Pic.countPages)

{

result += Pic.content;

}

else

{

result += Pic.content+"<p>";

}

}

 

return result;

 

Now, how can I do it to return the 2nd page of the same pdf they select? :confused:

Link to comment
Share on other sites

The rule you have should work. You just need to create an Overflow page for the body page to flow into, as in this example:

http://forums.pti.com/showthread.php?t=37

I completely confused... I borrowed this code from a template we already have that has only one page variable, and the back page is static. The new template has 50 pdf's that are all 2 pages, so I want to pull the pdf and place page 1 on page one and page 2 on page 2. The way the template I borrowed from is set up, the frame is a graphic frame. The example you pointed me to is a text frame.

 

To make matters worse, I decided to take and create another rule to just create the back page from a separate pdf. When I did this and previewed it, it worked wonderfully. However, when I upload to Marcom and preview it there, there is no back page. So now I am really confused :D:( I'm attaching the pdf here for what worked in preview in acrobat, but not in marcom.... any further suggestions? :confused:

HR Medicare.pdf

Edited by n2_space
Link to comment
Share on other sites

Using the pdf you supplied do the following and it should work on Marcom.

 

Change the back page to a regular page not overflow. (always 2 pages)

 

Add to javascript globals

function FileNameFromPath(fullPath)

{

return String(fullPath).replace(/^.*(\\|\/|\:)/, '');

}

Thanks! But, when I do this it just provides a blank page for the back side. How do I get it to pull page 2 of the pdf to put on the back? :confused:

Link to comment
Share on other sites

Sorry about that. I should have previewed my post. It didn't show everything I typed. You have to put in javascript globals and a new rule based on your naming convention. I'll attach a collect that should have everything you need to see how I got it to work.

You rock, thank you so much! :D :D:D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...