Discussion about this post

User's avatar
Tom Mort's avatar

OK, thanks. I did some searching and found out where to enter a document level script.

Went to Tools/Javascript/Document Javascripts and pasted this in:

var ocg=this.getOCGs();

for(var i=0;i<ocg.length;i++)

{

ocg[i].state=(this.getField(ocg[i].name).value!="Off")

}

tried a couple times and got errors, deleted some things and it seemed to work, pasted the code between the brackets the last time.

It did work with Foxit reader which is supposed to be compatible with Acrobat forms and controls. I tried on a couple of browsers, Chrome and Edge and the checkboxes don't work with those.

I thought I read that browsers could also work with these sorts of pdfs.

As long as there is an easy to get reader. I know Acrobat Reader works and I heard Foxit as well. I'll see what others might also work and what platforms they are available for.

I'm doing something very similar and will recreate this with watermark OSGs that use my image files.

I want to have several layers of image files stacked on top of each other and be able to vary the transparency/opacity of each layer. I played around a little with some image file watermark OSGs and found that if I had several layers of the same image each at say 20% opacity that I could vary the opacity of the number of that layer I made visible at the same time. I'm thinking although it would be busy and cumbersome I could have a row of checkboxes for each layer to change the number that are visible and in the process change the opacity.

I also want to investigate creating a slider with script to control the opacity of a stack of stamps. That seems more intuitive to use.

Expand full comment
Tom Mort's avatar

I went ahead and switched to an external editor and it worked. Notepad didn't, I even selected it with the selector. notepad++ did though. The watermark layers turn on and off now. I noticed in notepad++ that the hotkey for save is control S. That sounds familiar. I'm thinking I might have needed to use a hotkey in the built in editor and suspect that is it, but I haven't tried it yet.

I still don't understand where I put the script for initial state though. I looked at the properties tab for the checkbox controls and didn't see it and I thought I looked through every tab and combo box.

Expand full comment
5 more comments...

No posts