Cat Posted August 29, 2023 Posted August 29, 2023 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 Quote
Dan Korn Posted August 29, 2023 Posted August 29, 2023 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(); 1 Quote
Cat Posted August 29, 2023 Author Posted August 29, 2023 Dan, Love me some clean code, but... as usual, there was some user error. To make this work in MarcoCentral, I needed to: Make the field an "Image Drop-down Only". Set the "First Drop-Down Value Blank" to "No" Be sure the field was active and hidden. Just to review (for myself & others) in FusionPro/Acrobat Create an image file for the FPO/Keyline that will be used in the "KeylineGraphic" graphic frame (position the frame on an appropriate layer) Add the image as a Graphic Resource. Add an "OnRecordStart" rule with the following code: FindGraphicFrame("KeylineGraphic").suppress = !IsPreview(); 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" List the FPO image file name in the Data Source file for the document. 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 Quote
Recommended Posts
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.