Skip to main content
jctremblay
Community Expert
Community Expert
November 9, 2017
Question

Set specific layer to Never Print using JS

  • November 9, 2017
  • 1 reply
  • 1024 views

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 has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
November 9, 2017

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

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
jctremblay
Community Expert
Community Expert
November 9, 2017

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

Thom Parker
Community Expert
Community Expert
November 9, 2017

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

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