Jump to content

Return only 1 page of PDF based on Field


KDeLay

Recommended Posts

Super new to FusionPro. I reached out to Marcom for help with this and they recommended that I use the PageUsage rule but I'm having a hard time writing the proper code to make this work.

I have a 2 page PDF, each page is a different template. If the field "design" is "Basic" then I only want it to use page 1. If the field is "Featured" then I want it to only use page 2.

Help!

Link to comment
Share on other sites

 

So add all pages as a single PDF, i.e. fronts and back with their variable frame layouts and specified field names within.  Then name each page(Fusionpro>>Manage Pages>>Page Usage

Set the pages to “Unused”. Instead of naming the pages, giving them unique names for the fronts 

 

Then create the rule, (Create Rules>>New>>>Callback>>OnRecordStart). We will use the field values as in this sample code.

 

 The rule below can be simplified greatly by only activating the page you need, since all the pages are marked unused initially. 

 

So it can be reduced like this example:

 

                if (Field("Design") == "Basic")

                     FusionPro.Composition.SetBodyPageUsage("Basic Page 1", true);

              

                if (Field("Design") == "Featured")

                    FusionPro.Composition.SetBodyPageUsage("Featured Page 2", true);

             

 

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...