StacyZ Posted February 14, 2020 Share Posted February 14, 2020 Hello, I'm trying to set up a new German envelope and running into difficulty getting the multi-page resource to work correctly. Background info: Deutsche Post (German Post) is requiring that we use the Premium Address barcode on all of the envelopes we send with our direct mail. We have to use their software to produce that barcode, which is unique for every customer. Once we load our data into the DP software and run the file, it produces all of the addresses from our data with their corresponding barcodes on a single PDF file with each record on one page. I downloaded the sample file from this thread on inserting a Multi-page pdf as variable graphic: http://forums.pti.com/showthread.php?t=37 I then made some adjustments to match with my data and got the following rule, which isn't working: FieldName = 'IMP6'; PDFfileName = 'DialogLabels.pdf'; pagesInPDF = 66726; markupToReturn = Resource('DialogLabels.pdf'); pathToAllPDFs = 'C:\Users\Stacy.Zech\Desktop\PUSH\=Projects\PremAdd_Labels\TestEnvelope(DE-F001)\Links'; pathToPDF = 'C:\Users\Stacy.Zech\Desktop\PUSH\=Projects\PremAdd_Labels\TestEnvelope(DE-F001)\Links'; PDFresourceRef = 'DialogLabels.pdf'; Print(pathToAllPDFs); FieldsToInspect = 61; for (fieldCounter = 1; fieldCounter <= FieldsToInspect; fieldCounter++) { FieldName = 'SEQNO'; PDFfileName = Field('IMP6'); pathToPDF = pathToAllPDFs + PDFfileName; PDFresourceRef = CreateResource(pathToPDF ,'DialogLabels.pdf' ,'no'); pagesInPDF = PDFresourceRef.countPages; for (pageLoop = 1; pageLoop <= pagesInPDF; pageLoop++) { markupToReturn += '<graphic file="' + PDFresourceRef.name + '" pagenumber = "' + pageLoop + '" position="afterline"/>'; markupToReturn += '<P>'; } } return markupToReturn; What I am getting when I compose is the first page from the resource PDF showing on the 2nd page, which should be an overflow page. Any help on this would be greatly appreciated. Thank you Quote Link to comment Share on other sites More sharing options...
Alex Marshall Posted February 14, 2020 Share Posted February 14, 2020 Try adjusting the dimensions of the text frame by .2 Quote Link to comment Share on other sites More sharing options...
StacyZ Posted February 14, 2020 Author Share Posted February 14, 2020 Hi Alex, I tried that but it didn't work. The output is the same with only the first address showing on what should be the overflow page, not the envelope front (page 1). Thank you Quote Link to comment Share on other sites More sharing options...
StacyZ Posted February 17, 2020 Author Share Posted February 17, 2020 I was able to get the PDF to show in the correct place and on the correct page but it won't show anything other than the first page of the resource pdf for every record in the output file. Quote Link to comment Share on other sites More sharing options...
StacyZ Posted February 18, 2020 Author Share Posted February 18, 2020 Just in case anyone else has this problem and is looking for answers. It turns out that this simple rule worked instead: var r = new FusionProResource(Field("IMP6"), "graphic", true); r.name = (Field("IMP6")); r.pagenumber = CurrentRecordNumber() if (r.exists) { return r; } else { return NullResource(); } Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted February 19, 2020 Share Posted February 19, 2020 The key bit of info in your original post is that you're composing "a single PDF file with each record on one page." So yes, in that particular case, you need call out each page of the resource for each output record. Though I don't see why you would need an Overflow page at all in such a scenario. The sample code in that other thread is for what is surely the far more common case of outputting multi-page records. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.