Skip to main content
Known Participant
April 16, 2020
Question

Javascript Errors with Digital Signature

  • April 16, 2020
  • 1 reply
  • 7106 views

Hi,

 

Attached are the 2 javascript-related error messages that pop up when digitally signing a document in Adobe DC Standard (tried 2015 and continuous, both had the issue). Usually error 1 pops up than error 2 right after, but sometimes only 1 appears. When this happens, the PDF gets curropted, so the user has to close/reopen the unsigned file to sign again.

 

We do have a document manager. I've tested digitally signing when the document manager is closed, and Adobe does trigger its own "save-as" by opening file explorer to save the signed copy with a new name. However, when the document manager triggers this same thing (just offers the option to save in the DM), these errors appear.

 

I've tried repairing Adobe, uninstall/reinstall, removing and re-adding the digital signature, and most recently, disabling the "save-as optimizes for fast web view" option in Preferences>Documents in Adobe.

 

Is there an Adobe option that can fix this? I think it's basically being told to "save-as" the signed document which causes Javascript errors and curropts the document. Any suggestions for options to bypass this? We can't turn off the document manager.

This topic has been closed for replies.

1 reply

ls_rbls
Community Expert
Community Expert
April 17, 2020

If you're the creator of the source PDF you need to open the javascript console and see what exactly is the error(s) when the script execute.

 

You should also share this javascript code so that the developers in the community forums can assist you better.

 

Something is throwing an exception in the jscript when the Save As action is applied.

 

See if this is also related to an exception that  you may  be able to fix by manually setting a breakpoint in that script or a conditional break.

 

See pages 108-109 of the Acrobat Javascript Scripting Reference Guide, "Dbg Methods".

 

  • From the way it looks, if you go to page 273 of the Adobe JavaScript Scripting Reference Guide, "Field Methods", you may need to check if your jscript is specifying the appropriate security handler with parameters.

 

See in that page the oSig, oInfo, cDIPath, parameters.

 

Also verify if your script is a document or folder level script with a defined "this.saveAs " event object.

 

I suspect this is the problem when you use this PDF with the DM.

 

If the parameters  that are currently used when the signature is applied indicate to save to a particular path, or lack specification of a path, it will create a conflict because part of the script is expecting to find the user's directory path before the save as action. Whereas if it doesn't specify it will take the current user preferences as the default to save the file as.

 

In addition, See page 66, "execMenuItem" 

 

The NOTES  in red, the second paragraph specifically says, "If the user preferences are set to "Save As creates Fast View Adobe PDF Files", do not expect a form object to survive a "Save As"; Field Objects are no longer valid, and an exception may be thrown when trying to access a fiels object immediately after "Save As".

 

 

Known Participant
April 17, 2020

Thanks for the detailed reply! I admit that I'm not familier with debugging javascript, but as this error only appears when I "save as a new file" in the document manager (instead of replacing the unsigned file), I've contacted them. Interestingly, this doesn't happen on a different PC using the same PDF, so it's a difficult issue to track.

 

Save-as optimizes for fast web view doesn't affect the error whatsoever. Also, if this is a file-lock issue (one of the errors say that the file is open elsewhere), I've already disabled file preview in file explorer and the DM....any other places to check for this?

ls_rbls
Community Expert
Community Expert
April 17, 2020

Yes, it would be helpful if  you can open the event viewer and see what is triggered there as additional errors, and/or sharing  an Acrobat log file.

 

In windows 7 or later, all Acrobat logs are found here:

 

C:\Users\--\AppData\Local\Temp

 

But I am curious if you are able to sport anything here: C:\Users\--\AppData\Local\Temp\AcrobatSaveAs