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

document close handler not executing

Community Beginner ,
Jul 01, 2021 Jul 01, 2021

Copy link to clipboard

Copied

Hi,

 

so I've created a document with various handlers open/close/print/save etc.

 

All of them are executing and the js is triggered except close document handler:

 

The handlers were added with this dictionary:

 

8 0 obj
<<
/DC 9 0 R
/DP 10 0 R
/DS 11 0 R
/WP 12 0 R
/WS 13 0 R
>>
endobj

 

The JS  for close looks like this:

 

9 0 obj
<<
/Type /Action
/S /JavaScript
/JS (
h = 99
app.alert({cMsg: 'close PDF', cTitle: 'Testing PDF JavaScript', nIcon: 3});
)
>>
endobj

 

 

Also another interesting thing I noticed is that the scope is shared between all these handlers. If I set a variable somewhere it's visibile in all the handlers. In which case I can set variable/functions in open and call them everywhere......

TOPICS
Acrobat SDK and JavaScript , Windows

Views

66

Likes

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 ,
Jul 02, 2021 Jul 02, 2021

Copy link to clipboard

Copied

There's no DC ("did close") action. By now, there is nothing to run, because the document is closed. Check your documentation again.

Likes

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 Beginner ,
Jul 02, 2021 Jul 02, 2021

Copy link to clipboard

Copied

I'm sure I got that from the docs some time ago.

 

thanks.

Likes

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 ,
Jul 04, 2021 Jul 04, 2021

Copy link to clipboard

Copied

LATEST

Where have you read this?

The event Document Will Close does exists.

Likes

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