Skip to main content
jctremblay
Community Expert
Community Expert
Nov 9, 2017 5:50 PM UTC
Question

Set specific layer to Never Print using JS

What would be the best way to automate with JS for changing a specific layer in PDF to have is Print Initial State to «Never Print»? Is it possible?

This topic is closed to new replies. Start a new post to keep the conversation going.

6 replies

Thom Parker
Community Expert
Community Expert
Nov 9, 2017 6:05 PM UTC

The print setting, as well as many other OCG properties cannot be accessed from JavaScript.

Whenever I have to do a task like this I write a simple plug-in to perform the single task. Usually using JavaScript parameters.  Then activate the plug-in from my script with a menu item. In fact I wrote a plug-in for modifying several OCG parameters that are not available from the Acrobat UI.  You'll find it here (along with lots of other cool stuff): www.pdfscripting.com

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
jctremblay
Community Expert
Community Expert
Nov 9, 2017 6:10 PM UTC

Thanks Thom! Probably will need to renew my membership to it soon!

Translate
Thom Parker
Community Expert
Community Expert
Nov 9, 2017 6:40 PM UTC

Appreciate it .  We can also create a custom plug-in for your specific purpose.

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often