rbjformula.dk Posted March 5, 2010 Share Posted March 5, 2010 Hi I have problems with a graphic rule. it only returns page 1 ind the pdf file. Resource("a4.pdf").PDFPageNumber == Field("number") return Resource("a4.pdf") can anybody help René Jarmer Link to comment Share on other sites More sharing options...
mhilger Posted March 5, 2010 Share Posted March 5, 2010 Hello René, Assuming your Field "number" contains the page number you want to use of the PDF resource, try this: res = Resource("2pager.pdf"); res.pagenumber = Field("number"); return res; Link to comment Share on other sites More sharing options...
rbjformula.dk Posted March 8, 2010 Author Share Posted March 8, 2010 Hello Mark The new code worked, tanks René Jarmer Link to comment Share on other sites More sharing options...
esmith Posted March 9, 2010 Share Posted March 9, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.