David J Posted April 17, 2009 Share Posted April 17, 2009 I have a job that has 1 pdf with four pages. Pages 1 and two represent the front and back of post card #1(in the data file, under the store field tagged"T", pages 3 and 4 represent the second post card tagged "B". How do I pull in the PDF and assign the pages??? David Link to comment Share on other sites More sharing options...
DSweet Posted April 20, 2009 Share Posted April 20, 2009 Morning David, If you are trying to load in and select a specific pdf page from a multiple page file as a graphic then you would need to use a special feature used with pdf graphic files called "pagenumber" which can select a specific page. Many times I have templates where the customer uploads a postcard or sell-sheet image or something of the like and we just need to impose it and maybe merge an address list for mailing so I use this function in my rule... var r = new FusionProResource(Field("pdfUpload"), "graphic", true); r.name = (Field("pdfUpload")); r.pagenumber = xx; if (r.exists) { return r; } else { return NullResource(); } This will pass the graphic "r" set to a specific page (xx) of a pdf file that has been uploaded. If the graphic isn't there, or if they have uploaded a single page graphic for use within a template set for a double sided item, then a blank NullResources() image is passed so as to not crash the template. This graphic could also be set to some other default at times to force a graphic with the words "Non-Existing Graphic" or some other warning to appear on the customer proof so they know that their uploaded graphic does not properly work within this template. Good Luck. Link to comment Share on other sites More sharing options...
esmith Posted April 21, 2009 Share Posted April 21, 2009 My apologies if I'm off in left field, but I read the OP a different way. My understanding is that David J has a front and back for two postcards in his FP PDF and his data indicates whether a given record uses card 1 or card 2. In this scenario, I use the Manage Pages/Page Usage... option from the Fusion Pro menu to assign names to each page in the PDF. In this scenario, I would name the pages: page 1 -- T-front page 2 -- T-back page 3 -- B-front page 4 -- B-back I would also set all 4 pages to be unused by checking said box in my dialog window. Next I would add the following code to an OnRecordStart callback rule: CardFront = Field("Store") + "-front"; CardBack = Field("Store") + "-back"; FusionPro.Composition.SetBodyPageUsage(CardFront,true); FusionPro.Composition.SetBodyPageUsage(CardBack,true); This code creates two global variables with values that match the page names of the version the current record requires and tells the composition engine to render that record using the specific pages associated with that card. From there you simply set up your variable graphic elements on the necessary pages (if both cards mail, you would need to include a copy of the variable elements on both "front" and/or "backs") and compose your file. Previewing works as well in which case your data will only display on the pages called in your data record. Hope that helps. Link to comment Share on other sites More sharing options...
David J Posted April 21, 2009 Author Share Posted April 21, 2009 This works like a charm!!!! Thanks so much for your help......... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.