Skip to main content
SraBrennan
Participating Frequently
November 12, 2021
Question

Action to disable print dialog box upon opening

  • November 12, 2021
  • 1 reply
  • 2773 views

Hello, very novice javascript user here.

I have been using a .sequ to disable the automatic print window from opening by executing the following script:

this.removeScript("0000000000000000");

It successfully removes files received with existing script:

//<Document-Level>
//<ACRO_source>0000000000000000</ACRO_source>
//<ACRO_script>
/*********** belongs to: Document-Level:0000000000000000 ***********/
this.print({bShrinkToFit: true});

//</ACRO_script>
//</Document-Level>

Now I am trying to adapt that script to create a new .sequ to disable the print box for files received with the following:

//<Document-Actions>
//<ACRO_source>Document Open</ACRO_source>
//<ACRO_script>
/*********** belongs to: Document-Actions:Document Open ***********/
this.print({bUI:true,bSilent:false,bShrinkToFit:true});
//</ACRO_script>
//</Document-Actions>

I have tried the following three scripts without success:

this.removeScript("Document Open");
this.removeScript("{bUI:true,bSilent:false,bShrinkToFit:true}");
this.removeScript(";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;");

 

I know it's possible to disable each PDF individually by adding "//" to the beginning of "this.print" line, but a batch sequence would be so much more efficient, as I have quite a few to do.

 

Any help would be appreciated.

This topic has been closed for replies.

1 reply

Bernd Alheit
Community Expert
Community Expert
November 12, 2021

What can you see at Tools > JavaScript > Document JavaScripts?

SraBrennan
Participating Frequently
November 12, 2021

This is what I see:

try67
Community Expert
Community Expert
November 13, 2021

Yes I get the same result at "Document Actions" tab => "Edit All...".

Is there a cure or am I doomed (to re-save each PDF individually)?


This sometimes happens when the file was created in a non-standard way. Acrobat is lenient with it and executes code, but JS has no access to it.