Jump to content

How to place a 2 page PDF in 1 template page?


Recommended Posts

Hi, I need to display 2 pages of a credit card sized PDF file on an 8.5 x 11 sized template page for proofing purposes. Is there a rule that will bring in a PDF file and insert page 1 and page 2 into separate graphic frames on the same template sheet? I've attached a sample.


Edited by Fabian
Link to comment
Share on other sites

  • 5 months later...

I have a 2 page variable product on the storefront. There is a 2 page pdf uploaded and I want to put page1 of the uploaded pdf to a graphic frame on the products page 1 and put the page 2 of the uploaded pdf on the second page of the product. I can get page one to work but can't get page 2 to work. It just shows up blank. Page 1, I'm just returning the field so it automatically puts page 1 of the pdf in the graphic frame.


I have tried this rule

var bg = CreateResource(Field("pdf")

Link to comment
Share on other sites


My post was cut off a little and didn't notice it. I did try that code and I also tried your code. It works on the desktop but when I load it to Marcom it doesn't show the back. Do you have any javascript globals or anything besides those graphic rules?

Link to comment
Share on other sites

I'm not using any globals or other rules. If this is for a Marcom upload field you will need to use the CreateResource function as Eric mentioned above. I don't think the code I posted would work unless the PDF is already associated. It does seem odd that it's displaying page 1 but not page 2. I would try a few different multiple page PDFs as well to rule out it's not a problem with the source file.


Another method you could try is putting the JavaScript in OnRecordStart instead. You will need to name the frames and remove the other graphic rules.


var r = CreateResource(Field("pdf"), "graphic");

r.pagenumber = 1;

r.pagenumber = 2;

Edited by ThomasLewis
Modified JavaScript
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.

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...