sschardan Posted February 6, 2009 Share Posted February 6, 2009 I have a project where I have base art, and the only variable is a supplied multiple page pdf containing imprints. My idea was to create a variable graphic frame and have the pdf graphic page number change based on record number. Here is my script: var pic = CreateResource(".//imprints//"+"58336_Imprints.pdf", "graphic", true) var record = Resource("record number") pic.pagenumber = record return pic Link to comment Share on other sites More sharing options...
sschardan Posted February 6, 2009 Author Share Posted February 6, 2009 The rest of my post got cut off. So.... The resource "record number" is a formatted text rule that is a sequential numbering rule. When this resource is used by itself, it functions properly. However, when embedded into this rule, I only get pg. 1 of the pdf for all the records. When I manually change the pic number to be 3 or 4, etc., I do get the proper page. How can I get this rule to function properly, and dynamically change the page number based on record number? Thank you, Scott Link to comment Share on other sites More sharing options...
Dan Korn Posted February 6, 2009 Share Posted February 6, 2009 The resource "record number" is a formatted text rule that is a sequential numbering rule. I don't understand this statement. A resource is not a rule. A resource can use a rule, and a rule can use a resource, but they're not interchangeable. Whatever value you assign to the Resource.pagenumber property has to be convertible to a number, which the FusionProResource object returned from the Resource function is not. If you have a rule that returns a numeric value, you could assign that, like so: pic.pagenumber = Rule("RecordNumber"); My idea was to create a variable graphic frame and have the pdf graphic page number change based on record number. If all you want to do is match the resource's page number to the current record number in the composition, you can use the built-in CurrentRecordNumber function: pic.pagenumber = CurrentRecordNumber(); Link to comment Share on other sites More sharing options...
sschardan Posted February 6, 2009 Author Share Posted February 6, 2009 Thanks, Dan. Both of those work. Sorry for the confusion on the resource. The resource that I was using in my script was a formatted text resource that contained my sequential numbering rule. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.