Jump to content

Callback on multiple pages


Recommended Posts

Hi,

 

I have a callback I am trying to use on two seperate pages. It works on my first page "Front" but not on my second page "Front-Proof".

 

Still learning this but I thought the SetBodyUsage would do it and no luck.

 

FusionPro.Composition.SetBodyPageUsage("Front",true);

FusionPro.Composition.SetBodyPageUsage("Front-Proof",true);

 

if(Trim(Field("attribute7")) == "Phnophoto")

{

FindTextFrame("CustomerName").suppress = true;

FindGraphicFrame("0Degrees").suppress = true;

FindGraphicFrame("90Degrees").suppress = true;

FindGraphicFrame("180Degrees").suppress = true;

FindGraphicFrame("270Degrees").suppress = true;

FindGraphicFrame("Photo Border Color").suppress = true;

}

else

{

FindTextFrame("CustomerName2").suppress = true;

FindTextFrame("CustomerName3").suppress = true;

FindTextFrame("CustomerName4").suppress = true;

FindTextFrame("CustomerName5").suppress = true;

FindGraphicFrame("Logo").suppress = true;

}

 

Thanks,

Mike

 

FusionPro VDP Designer 8.2.7

Link to comment
Share on other sites

What exactly are you trying to do, and in what specific way is the output different than what you expect?

 

If you're trying to use the FindTextFrame function to find frames with the same names on multiple pages, that won't work. Frame names need to be unique throughout the entire PDF document. So you may need to name your frames with some convention such as "Page1-CustomerName1" et al. Then instead of listing all the frames individually, you could do something like this with loops:

    // ...
   for (var page = 1; page <= 2; page++)
   {
     for (var name = 1; name <= 5; name++)
     {
       FindTextFrame("Page" + page + "-CustomerName" + name).suppress = true;
    }
   }
   // ...

 

Or are you just trying to suppress the whole page? In that case, all you need to do is something like this:

if (Trim(Field("attribute7")) == "Phnophoto")
 FusionPro.Composition.SetBodyPageUsage("Front", false);
else
 FusionPro.Composition.SetBodyPageUsage("Front-Proof", false);

If you're not trying to suppress entire pages, then I'm not sure what the FusionPro.Composition.SetBodyPageUsage calls are doing. The body pages will all be enabled for output (usage set to true) by default, unless you set them to Unused in the Page Usage dialog. At any rate, the page usage doesn't affect how FindTextFrame works; the frame names still need to be unique across all pages.

 

Perhaps if you provide a bit more context about exactly what you're trying to do, or even post a sample job, then I or someone else may be able to offer more specific suggestions.

Link to comment
Share on other sites

Thanks for your quick reply Dan.

 

I was trying to use the FindTextFrame function to find frames with the same names on multiple pages so I guess that is why it wasn't working for me.

 

Ultimately what I am trying to do is have page "Front" be my print-ready page for a business card and have page "Front-Proof" be what the customer sees on the server that shows a border with cut lines.

 

I wanted them to see the business card minus the bleeds and with a black border around where the cuts go because they always think they can use that excess space. The only difference between page "Front" and page "Front-Proof" is I added another image that goes over it all blocking the bleeds out and shows the border.

 

I can go back and rename the frames but to be honest doing that on all of our designs would be pretty time consuming given all of the other rules that call the frames by their unique names. I would have to duplicate all the rules as well.

 

Regards,

Mike

Link to comment
Share on other sites

I was trying to use the FindTextFrame function to find frames with the same names on multiple pages so I guess that is why it wasn't working for me.

Yes, that's the problem.

Ultimately what I am trying to do is have page "Front" be my print-ready page for a business card and have page "Front-Proof" be what the customer sees on the server that shows a border with cut lines.

If you have FusionPro VDP Producer API (FP Server), you can change the CFG file settings for separate "proof" (or "preview") and "press" compositions. This is what most web-to-print systems such as MarcomCentral do.

I wanted them to see the business card minus the bleeds and with a black border around where the cuts go because they always think they can use that excess space. The only difference between page "Front" and page "Front-Proof" is I added another image that goes over it all blocking the bleeds out and shows the border.

If the "proof" is a JPEG, you can specify whether to include the bleed area in the JPEG output settings. Otherwise, you can modify the Bleed setting in the CFG file to change the primary PDF (or other format) output. You can set the BleedMark=Yes setting to show crop marks. With the Producer API, you can even add new frames to the pages.

I can go back and rename the frames but to be honest doing that on all of our designs would be pretty time consuming given all of the other rules that call the frames by their unique names. I would have to duplicate all the rules as well.

The logic for this should be in your web application code that's driving FusionPro via the Producer API, not in JavaScript rules.

Link to comment
Share on other sites

Hi Dan,

 

Since also all of the lines of text and my graphics are rule based I ended up just adding this to each rule as need and seems to have solved my problem. Now I have the proof page they way I needed it.

 

if(Trim(Field("attribute7")) == "Phnophoto")

return "";

else

return "do this"

 

Thanks for your help,

Mike

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...