Jump to content

I'm trying to use code for online preview only, that has worked in the past, but now I can't get it to work in the MarcomCentral product.


Cat

Recommended Posts

I have used the following code to have images show in an on-line only preview:

//access the “isOnlinePreview” property and the “isPreview” property

onlinePreviewVal = FusionPro.Composition.JobOptions.isOnlinePreview;
desktopPreviewVal = FusionPro.Composition.isPreview;

//if this is a preview composition or a desktop preview
//then return the text “PROOF”

if (onlinePreviewVal == "Yes" || desktopPreviewVal == true)
FindGraphicFrame("KeylineGraphic").suppress = false;

else 
FindGraphicFrame("KeylineGraphic").suppress = true;

However, now I cannot get the above code to work. I've looked at the items where is -does- work and I cannot see what I'm missing.

I build items in FusionPro and then place them as versioned products in MarcomCentral. Working on a Mac, using Acrobat Pro.

ID71_RPIS015R_Recruiting Sign_11x17.zip

Link to comment
Share on other sites

The value of the "isOnlinePreview" setting in the CFG file may not exactly match the string "Yes" case-sensitively.

The global IsPreview() function is more robust, and will check for other variations in the CFG value, as well as checking for desktop preview.

SoI would use that instead, like so:

if (IsPreview())
    FindGraphicFrame("KeylineGraphic").suppress = false;
else
    FindGraphicFrame("KeylineGraphic").suppress = true;

Or, more simply, just this:

FindGraphicFrame("KeylineGraphic").suppress = !IsPreview();

 

  • Thanks 1
Link to comment
Share on other sites

Dan,

Love me some clean code, but... as usual, there was some user error.

To make this work in MarcoCentral, I needed to:

  1. Make the field an "Image Drop-down Only". 
  2. Set the "First Drop-Down Value Blank" to "No"
  3. Be sure the field was active and hidden.

 

Just to review (for myself & others)

in FusionPro/Acrobat

  1. Create an image file for the FPO/Keyline that will be used in the "KeylineGraphic" graphic frame (position the frame on an appropriate layer)
  2. Add the image as a Graphic Resource.
  3. Add an "OnRecordStart" rule with the following code: 
    FindGraphicFrame("KeylineGraphic").suppress = !IsPreview();
  4. Make sure you have a graphic frame called "KeylineGraphic" that is linked to the field name for the FPO image, and that the field is set to "Graphic"
  5. List the FPO image file name in the Data Source file for the document.
  6. Make sure you upload the FPO image file to MarcomCentral so that it is available to the product.  

Let me know if I've over-complicated this process, but this seems to be the way to make this work in my case.

Thank you

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