Skip to main content
Participating Frequently
April 21, 2020
Question

Can't save Javascript in PDF form

  • April 21, 2020
  • 3 replies
  • 3028 views

I have a simple Javascript that calculates the number of checked checkboxes. But after saving the file all javascripts are lost. I tried to lock, did not use the previews and did many other actions and nothing helps. What I do wrong?

UPD. Thank you all. I cancelled my plan on Adobe, because as I can understand, none can help me and technical support on Adobe does not work for non-standart cases. I will try to do my project with other tools.

This topic has been closed for replies.

3 replies

try67
Brainiac
April 21, 2020

How are you saving it, exactly? It should not cause any code to be removed.

Participating Frequently
April 22, 2020

Just in very ordinary way, Save-as

I'd made the short screen video, all the interface is in Russian, but all functions are the same

https://youtu.be/2w2k0dY8ENA

 

Bernd Alheit
Brainiac
April 22, 2020

Try this:

Delete the field and re-create the field with the script.

Bernd Alheit
Brainiac
April 21, 2020

What code does you use?

Participating Frequently
April 21, 2020

var nSum = 0;

var aCkFlds = this.getField("CheckBox1").getArray();

 

for(var i=0;i<aCkFlds.length;i++){

  if(aCkFlds[i].isBoxChecked(0))nSum++;

}

 

event.value = nSum;

Bernd Alheit
Brainiac
April 21, 2020

Acrobat DC on Windows doesn't remove the code.

Eric Dumas
Brainiac
April 21, 2020

Hi,

Can you confirm the version of the software and operating system you are using?

Also, can you indicate were you are saving this document? It is possible that some protection service, like an antivirus, is trying to keep your PDFs 'clean' as it might feel your additional code could be malicious.

Participating Frequently
April 21, 2020

Thank you for the reply!

I think I have the latest version of the Acrobat DC

Architecture: x86_64

Build: 20.6.20042.371807

AGM: 4.30.98

CoolType: 5.14.5

JP2K: 1.2.2.45402

My OS is macOS mojave 10.14.5 and I'm trying to save in the Documents folder. I have no antivirus as I know...

I'm on my free tryal week before the buying the SW, cuold it be the root of the problem?