Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Action to disable print dialog box upon opening

Community Beginner ,
Nov 11, 2021 Nov 11, 2021

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.

TOPICS
Edit and convert PDFs , JavaScript
2.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 12, 2021 Nov 12, 2021

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 12, 2021 Nov 12, 2021

This is what I see:

Document JavaScripts.JPG

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 12, 2021 Nov 12, 2021

This is a bad created script or the document is damaged.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 12, 2021 Nov 12, 2021

I was in error! The above was copied from a document in which I tried to recreate the problem environment. Apologies. Having located a pesky original, here is what is present in Document JavaScripts:

Document JavaScripts empty.JPG

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 12, 2021 Nov 12, 2021

There is no script to remove.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 12, 2021 Nov 12, 2021

I see, so in other words, if the javascript lives under the "All JavaScripts" tab (and the "Document Actions" tab =>  "Edit All" pop-up), and not under the "Document JavaScripts" tab, there is no way to batch sequence its removal?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 12, 2021 Nov 12, 2021

What can you see at "All JavaScripts"? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 12, 2021 Nov 12, 2021

All Javascripts.JPG

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 12, 2021 Nov 12, 2021

Looks like a document action. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 12, 2021 Nov 12, 2021

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

Document Action popup.JPGIs there a cure or am I doomed (to re-save each PDF individually)?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 13, 2021 Nov 13, 2021

How did you created this document?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 16, 2021 Nov 16, 2021

It was sent to us as directly from a vendor, as part of a portfolio. Some exhibit the problem behavior and some do not, but they are all part of the same bundle.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 13, 2021 Nov 13, 2021

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 16, 2021 Nov 16, 2021

With Javascript you can remove the other document actions, but not document open.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 17, 2021 Nov 17, 2021

Ah! Okay, well, an attempt was made! I appreciate your time and effort, and that of try67.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 18, 2021 Nov 18, 2021
LATEST

You can remove doc-level ("document open") scripts with JS, but you have to know their name.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines