Jump to content

Multi pdf


Recommended Posts

Is there a way to apply Mark's logic above (or David Sweet's in this post) using the CreateResource function rather than adding the resource in the Resources dialog first? I would like to be able to build the search path/file name in JS and then return page 2 of the resulting file on the fly rather than needing to import the PDF graphic ahead of time. I'm trying this modification (on David's code):

var background = campaignPrefix + signCode + ".pdf";
var pathToBackground = searchPath + background;

var r = new FusionProResource(pathToBackground, "graphic", true);
   r.name = (background);
   r.pagenumber = 2;

if (signCode == "CPDS" || signCode == "DHT" || signCode == "THT") {
   return r;
   }
else return NullResource();

but it only returns page 1 of the PDF unless I manually add the PDF via the Resource dialog. What am I doing wrong?

 

EDIT: Interestingly, if I add the resource(s) manually and use Mark's solution, the preview ONLY works if the added resource is in the same location as the template. If I move the resource to a subdirectory (and update the location in the Resource dialog), the preview STOPS working, but the composed file is OK. Regardless, I need an option to create on the fly...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...