Jump to content

Help in selecting pdf page number


sschardan

Recommended Posts

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

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

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

Archived

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

×
×
  • Create New...