• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Ghost JavaScript and ghost Document Action enigma

Community Expert ,
Sep 21, 2018 Sep 21, 2018

Copy link to clipboard

Copied

Hi experts.

Today I received a strange PDF document, when it is opened it automatically launch the Print command.

So I tried to remove this unwanted Action with Acrobat Pro DC.

But I cannot find it, it can only be seen in JavaScript : All JavaScript, and it's labelled "Belong to: Document-Actions : Document Open" (see screengrabs), and it's not a Page Action.

I never heard about a Document Action named "Document Open", I cannot find it in the Acrobat UI nor in the SDK JavaScript Referenceā€¦

The only clue I have is the document creator : Skia/PDF

Did I mess something obvious or is it a real mystery?

You can download this PDF here: Shared Files - Acrobat.com

Capture_065.png

Capture_062.png

Capture_060.png

Capture_063.png

Capture_064.png

Capture_066.png

TOPICS
Acrobat SDK and JavaScript

Views

629

Translate

Translate

Report

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 ,
Sep 21, 2018 Sep 21, 2018

Copy link to clipboard

Copied

It's just the internal name of that doc-level script. I've seen it happen in the past that such scripts that were applied using external tools don't show up in the Document JavaScripts window (probably because they were not defined completely correctly), but they still execute when the file is opened.

Votes

Translate

Translate

Report

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 ,
Sep 23, 2018 Sep 23, 2018

Copy link to clipboard

Copied

It's just the internal name of that doc-level script.

Did you try to remove this script?

I cannot: I can delete it and save the PDF, and when I reopen the PDF it's still hereā€¦

Votes

Translate

Translate

Report

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 ,
Sep 23, 2018 Sep 23, 2018

Copy link to clipboard

Copied

JR_Boulay  wrote

It's just the internal name of that doc-level script.

Did you try to remove this script?

I cannot: I can delete it and save the PDF, and when I reopen the PDF it's still hereā€¦

The file without the script:

Shared Files - Acrobat.com

Votes

Translate

Translate

Report

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
LEGEND ,
Sep 21, 2018 Sep 21, 2018

Copy link to clipboard

Copied

There is a document open action, but Acrobat has never provided a UI for setting an action for it. See the PDF Reference for more info (OpenAction).

Votes

Translate

Translate

Report

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 ,
Sep 23, 2018 Sep 23, 2018

Copy link to clipboard

Copied

See the PDF Reference for more info

As you can see on the screengrab above, there is nothing about a "Document Open" action in the PDF Reference.

Votes

Translate

Translate

Report

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 ,
Sep 23, 2018 Sep 23, 2018

Copy link to clipboard

Copied

Your screenshot shows the JavaScript API documentation, not the PDF specification.

in the 1.7 version of the spec, itā€™s in table 28

Votes

Translate

Translate

Report

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
LEGEND ,
Sep 23, 2018 Sep 23, 2018

Copy link to clipboard

Copied

It's been around for a long time, before forms and JavaScript were added to the spec. I know that it was supported for JavaScript placed there in Acrobat/Reader 4, not certain about before that. With JavaScript, it's not really needed since we can use document-level scripts to execute code on document open, but it was a sneaky way to hide code that we didn't want people messing with easily, as well as other types of actions. There was a malicious PDF (Peachy) that used this technique, and because it used OpenAction for which there's no UI in Acrobat for viewing/editing such actions, there was a lot of consternation.

Votes

Translate

Translate

Report

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 ,
Sep 24, 2018 Sep 24, 2018

Copy link to clipboard

Copied

LATEST

Thank you to all.

Now I am less ignorant.

Votes

Translate

Translate

Report

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