Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 17th, 2016, 07:56 AM
Printing Partners Printing Partners is offline
Regular Contributor
 
Join Date: Feb 2016
Location: Indianapolis, IN
Posts: 60
Default Watermark with opacity

I have a script from Marcom Customer Support for applying a watermark to an online proof. It works very well. However, I need it to "ghost" over the preview so that you can see or read what is under it.

I have tried applying opacity to the image, that didn't work. So I was wondering if it could be done with the Javascript. I created the scrip below, but the opacity is still 100% in the preview.
Code:
//This script applies the word PROOF to previews
//access the "isOnlinePreview" property and the "isPreview" property Text
 
onlinePreviewVal = FusionPro.Composition.JobOptions.isOnlinePreview;
desktopPreviewVal = FusionPro.Composition.isPreview;
 
//if this is a preview composition or a desktop preview
//then return the graphic "PROOF"
 
if (onlinePreviewVal == "Yes" || desktopPreviewVal == true)
    {
        FindGraphicFrame("watermark").suppress = false;
        FindGraphicFrame("watermark").style.opacity = "0.7";
        FindGraphicFrame("watermark").style.filter  = 'alpha(opacity=70)'; // IE fallback
    }
 
else 
     {
        FindGraphicFrame("watermark").suppress = true;
    }
Any ideas? Can this be done?

Thanks,
Steven

____
Fusion Pro Version: 9.3.26

Last edited by Printing Partners; August 17th, 2016 at 08:00 AM..
Reply With Quote
  #2  
Old August 17th, 2016, 09:02 AM
Printing Partners Printing Partners is offline
Regular Contributor
 
Join Date: Feb 2016
Location: Indianapolis, IN
Posts: 60
Default Re: Watermark with opacity

I still have not found a script solution. But did find that using a TIFF and reducing the opacity sort of works. MarcomCentral really pixelates the image, but it will work.

Still want a better solution if one exists.
__________________
_____________________
FusionPro Version: 10.0.3
Mac OS X: 10.11.6
Reply With Quote
  #3  
Old August 17th, 2016, 10:41 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,694
Default Re: Watermark with opacity

If you want to use text, you can't set the opacity, but you can set text to be outlined/stroked, in the Advanced Text Effects dialog. Select the frame, then click the button at the very bottom of the Text Frame Properties palette, to the right of the Overflow button. Then check the Stroke box.

If you want to use a graphic instead, then I would use a PDF, which you can set to have partially transparent text in an app such as Illustrator. Unlike a raster format such as TIFF, the text in a PDF is vector art, and won't be pixelated when it's scaled into a frame.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #4  
Old August 19th, 2016, 10:08 AM
Printing Partners Printing Partners is offline
Regular Contributor
 
Join Date: Feb 2016
Location: Indianapolis, IN
Posts: 60
Default Re: Watermark with opacity

Dan,
I tried the PDF route, changing the opacity of the vector image in Illustrator. The graphic would come in lighter, but have no transparency. You could not see the business card text under the graphic.
PDFs and opacity don't always play well with each other depending on what viewer is being used.

Since MarcomCentral uses Flash to preview the products, that might be my problem. But even downloading a PDF and looking at it in Acrobat it showed no opacity/transparency change. Again the graphic was lighter, but not transparent.

By using a TIFF, MarcomCentral preserved the transparency of the image and allowed the text underneath to show through. But then there is the whole bitmap problem of jagged edges. The result achieved was what I wanted, it just didn't look good.

So my thought was to see if I could get the Javascript to change the opacity of the vector image as it placed it. This might be the wrong way to approach it, but I am grasping at straws.
__________________
_____________________
FusionPro Version: 10.0.3
Mac OS X: 10.11.6
Reply With Quote
  #5  
Old August 19th, 2016, 12:13 PM
David Miller David Miller is offline
Senior Contributor
 
Join Date: Oct 2008
Location: Hamden, CT
Posts: 266
Default Re: Watermark with opacity

Quote:
Originally Posted by Printing Partners View Post
Dan,
I tried the PDF route, changing the opacity of the vector image in Illustrator. The graphic would come in lighter, but have no transparency. You could not see the business card text under the graphic. PDFs and opacity don't always play well with each other depending on what viewer is being used.

Since MarcomCentral uses Flash to preview the products, that might be my problem. But even downloading a PDF and looking at it in Acrobat it showed no opacity/transparency change. Again the graphic was lighter, but not transparent.
We've used the attached PDF in hundreds of templates as a watermark for proofs in MarcomCentral. We've never had a problem with the transparency.

Can you post the PDF that you are trying to use?
__________________
David Miller
FusionPro VDP Creator 12.0.3
Adobe Acrobat Pro 2021
macOS Big Sur 11.6.2

Last edited by David Miller; April 29th, 2018 at 08:57 PM..
Reply With Quote
  #6  
Old August 22nd, 2016, 11:51 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,694
Default Re: Watermark with opacity

Quote:
Originally Posted by Printing Partners View Post
Dan,
I tried the PDF route, changing the opacity of the vector image in Illustrator. The graphic would come in lighter, but have no transparency. You could not see the business card text under the graphic.
Okay, that's not exactly what I suggested. But I did basically the same thing and got it to work. In Illustrator, I created a new document, then placed a raster image (a JPEG), then selected the layer containing the image in the Layers palette, then changed the layer's opacity in the Transparency palette. Then I saved that as a PDF, and used it as a resource in a graphic frame in FusionPro. I was able to see both other variable text and graphic content, as well as the static PDF background, behind the graphic.

The effect can be subtle, though, if the opacity of the graphic is too high, or the graphic and the contents behind it have similar luminosity.
Quote:
Originally Posted by Printing Partners View Post
PDFs and opacity don't always play well with each other depending on what viewer is being used.
That may be true, but Acrobat is the de facto arbiter of how a PDF should appear on screen. Although there are some Preferences in Acrobat which control how some things are displayed.
Quote:
Originally Posted by Printing Partners View Post
Since MarcomCentral uses Flash to preview the products, that might be my problem. But even downloading a PDF and looking at it in Acrobat it showed no opacity/transparency change. Again the graphic was lighter, but not transparent.
Well, if it's the same in Acrobat and in the Flash preview, then it's clearly not a viewer-specific issue.
Quote:
Originally Posted by Printing Partners View Post
By using a TIFF, MarcomCentral preserved the transparency of the image and allowed the text underneath to show through. But then there is the whole bitmap problem of jagged edges. The result achieved was what I wanted, it just didn't look good.
Yes, you want to avoid any extra rasterization or downsampling steps.
Quote:
Originally Posted by Printing Partners View Post
So my thought was to see if I could get the Javascript to change the opacity of the vector image as it placed it. This might be the wrong way to approach it, but I am grasping at straws.
No, you can't do that kind of image manipulation in FusionPro.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:28 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.