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

Adding a script to the Doc/WillClose only works once

New Here ,
Jun 06, 2018 Jun 06, 2018

Copy link to clipboard

Copied

I have some code in my document action "WillClose", but my script is called only once. Why this is happening?

I have Acrobat DC.

TOPICS
Acrobat SDK and JavaScript

Views

359

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 ,
Jun 06, 2018 Jun 06, 2018

Copy link to clipboard

Copied

The script will only run once when the document is about to close. When would you expect the script to run? You will have to open the document again, and then try to close to have the script triggered again.

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
New Here ,
Jun 06, 2018 Jun 06, 2018

Copy link to clipboard

Copied

Thanks, even though I have some changes and when Adobe ask me if I want to save my changes I answer "Cancel"

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 ,
Jun 07, 2018 Jun 07, 2018

Copy link to clipboard

Copied

Ah you mean WillClose is not called again if you cancel closing, then close again? Odd, I‘d expect WillClose to be called only after an affirmative prompt, hence still only once but when it really closes.

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
New Here ,
Jun 07, 2018 Jun 07, 2018

Copy link to clipboard

Copied

LATEST

Test Screen Name,

                               that's exactly what I want.

According to Adobe, WillClose is trigger BEFORE.

WillClose "Triggered immediately before the PDF is closed."

https://acrobatusers.com/tutorials/entering-document-actions

thank you all for your responses. Help me a lot.

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 ,
Jun 07, 2018 Jun 07, 2018

Copy link to clipboard

Copied

I've seen this issue reported before. It seems to be a bug in Acrobat.

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