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

javascript wont save

Guest
Jul 28, 2016 Jul 28, 2016

Hi All,

I'm having a rather bizarre problem when trying to implement javascript into a PDF Form using Adobe Acrobat Pro DC. It doesn't seem like it is using the javascript when the form is saved. Taking an old version of the form, I made a copy of it and tested it in Reader, where the javascript worked correctly. I then opened it in DC and, making no changes, had the option to save it. After saving it when making no changes, the javascript no longer works.

The field names and javascript is all copy and pasted from the working form.

Any help would be much appreciated.

Cheers

TOPICS
Acrobat SDK and JavaScript , Windows
1.8K
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 ,
Jul 28, 2016 Jul 28, 2016

It's not possible to use JS to save a form directly, unless it's backed up by a trusted function in a folder-level script.

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
Guest
Jul 28, 2016 Jul 28, 2016

Thanks for your reply try67. however it seems like you've misinterpreted my problem. The javascript doesn't save the form. The action of saving the form in DC is causing the javascript to stop working, almost like its being told to not work, or not be turned on.

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 ,
Jul 28, 2016 Jul 28, 2016

Ah, I see. That is strange... What kind of script is this? What's its purpose?
Also, did you write this code, or did someone else?

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
Guest
Jul 28, 2016 Jul 28, 2016

So I've been tasked with altering a form, I tried to edit the original, but it essentially broke the form with all sorts of random problems. From there I made a new form, with the same details. For the form entries the names are exact, they were copy+pasted from the old form. The script is meant to set the entries of a dropdown list depending on what is selected in the initial dropdown list. The script also checks the users login username and matches it to another script to then either allow the user to click a submit button and automatically email the form. The second script is located in C:\Program Files (x86)\Adobe\Reader 11.0\Reader\Javascripts

I am very confident that there is no faults with the script itself, or the form names as I have checked that side of things quite a few times. As I said in the question, the problem seems to arise when the pdf is saved in acrobat DC.

Cheers

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 ,
Jul 28, 2016 Jul 28, 2016

I think you answered your own question... You only installed the folder-level script under Reader, not under Acrobat.

If you look in the JS Console in Acrobat you'll probably see an error message about a function or a variable not being defined, or something similar to that.

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
LEGEND ,
Jul 30, 2016 Jul 30, 2016
LATEST

Just like the application installation folders are dependent on the product and version of Reader or Acrobat, so are the user application folders. You need to make adjustments in where you place your code according to your product and version. These folders will also be different on different computers Operating Systems.

How to Save a PDF with Acrobat JavaScript​ by Thom Parker

There was a significant change in the user JavaScript folder with Acrobat X version 10.1.1.

http://blogs.adobe.com/pdfdevjunkie/2011/09/javascript-changes-for-acrobat-x-and-reader-x-version-10...

JavaScript Changes for Acrobat X and Reader X, version 10.1.1

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