PDF JavaScript does not work in Adobe Reader DC, but all other readers

I cannot get my PDF to work on the web using Adobe Reader DC.

http://www.okeechobeecountytaxcollector.com/Documents/FeeCalculatorRev0909.pdf

None of the buttons or features work. (For example, when you press motorvehicles, or mobile homes, or any of these buttons at the top, it is assumed that you have selected options). But if I open in any other reader, it works great. Does anyone know how I can edit a document to work correctly in Adobe Reader DC? Are there any settings in the document or something that you need to change to work in DC?

I tried changing the settings in the security section on Acrobat X and later, but that also did not fix it.

+5
source share
1 answer

After checking your PDF document in the Adobe DC JavaScript debugger, I am afraid that there are only a whole bunch of syntax errors. When you correct one set of syntax errors, a whole new set of syntax errors appears. From what I can say (someone can hope to confirm this) is that JavaScript interpreters in older versions of Adobe are less stringent about how they interpret the language, so your forms work in older versions, but their stop the latest translators in Acrobat DC.

When I test JavaScript that throws errors, I not only notice that Adrobat DC really wants you to end your JavaScript instructions with semicolons (which your code sometimes does), but I also find very strange constructs, some of which forced to believe me that although your forms do not technically throw any bugs in older versions of Acrobat, you may find that the forms do not actually work properly in older versions.

So, in order to fix these errors and get your forms running in Adobe Acrobat DC, you will have to clear all errors that occur, which means transferring (updating) your coding style to the new level of rigor in the Acrobat DC runtime.

For example, when I first open a form using the JavaScript debugger in Acrobat DC, I see the following errors:

  SyntaxError: missing;  before statement
 121: Document-Level: CreditCalcException in line 5 of function top_level, script Page-Actions: Page1: Page Open: Action4
 ReferenceError: Loaded is not defined
 5: Page-Actions: Page1: Page Open: Action4Exception in line 2 of function top_level, script AcroForm: LoadCountyLock: Annot1: OnBlur: Action1
 ReferenceError: FormNumber is not defined
 2: AcroForm: LoadCountyLock: Annot1: OnBlur: Action1Exception in line 10 of function top_level, AcroForm script: ButtonMonth1.3.0: Annot1: MouseUp: Action2
 ReferenceError: MonthsNumber is not defined
 10: AcroForm: ButtonMonth1.3.0: Annot1: MouseUp: Action2Exception in line 10 of function top_level, script AcroForm: ButtonMonth1.0.0: Annot1: MouseUp: Action2
 Exception in line 10 of function top_level, script AcroForm: ButtonMonth1.1.0: Annot1: MouseUp: Action2
 ReferenceError: MonthsNumber is not defined
 10: AcroForm: ButtonMonth1.0.0: Annot1: MouseUp: Action2
 SyntaxError: missing;  before statement
 121: Document-Level: CreditCalc
 SyntaxError: missing;  before statement
 121:
 SyntaxError: missing;  before statement
 121:
 SyntaxError: missing;  before statement
 121:
 SyntaxError: missing;  before statement
 121:
 SyntaxError: missing;  before statement
 121:
 SyntaxError: missing;  before statement
 121:
 SyntaxError: missing;  before statement
 121:
 SyntaxError: missing;  before statement
 121:
 SyntaxError: missing;  before statement
 121:
 SyntaxError: missing;  before statement
 121:
 SyntaxError: missing;  before statement
 121:
 SyntaxError: missing;  before statement
 121:
 SyntaxError: missing;  before statement
 121:
 SyntaxError: missing;  before statement
 121:
 SyntaxError: missing;  before statement
 121:
 SyntaxError: missing;  before statement
 121:
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 77: AcroForm: DynolistHS: Annot1: MouseUp: Action2
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56:
 SyntaxError: class is a reserved identifier
 56:
 SyntaxError: class is a reserved identifier
 56:
 SyntaxError: class is a reserved identifier
 56:
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: missing;  before statement
 121:
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 56: Document-Level: SVCFees
 SyntaxError: class is a reserved identifier
 138: AcroForm: DynolistVehicle: Annot1: MouseUp: Action1

enter image description here

Note that you have all of these errors:

  SyntaxError: class is a reserved identifier
     SyntaxError: missing;  before statement

These are good indicators that the new JavaScript interpreter in DC keeps JS to a higher standard and uses new language features such as the class keyword, and the imposition of the agreement that semicolons should be used to complete statements.

As you continue to click on the PDF file, the JavaScript debugger starts complaining about even more errors in the same way (missing semicolons, functions that are not defined, etc.), so fixing one problem only opens another rabbit hole that is still identical Problems.

Thus, I would say that the fastest way to update this form and is ready for the latest version of DC is to go through your scripts and apply some conventions or listing to start cleaning the syntax (completion of all statements with a semicolon, etc. ) After you have cleaned the syntax, the JavaScript interpreter will most likely start to find declarations of functions that it could not find earlier (due to the fact that it considered invalid syntax), which (I hope) will clear the "function not defined" " .

In addition, I would just do some general testing so that your forms work the way you intend, because I see weird JavaScript like this sample taken from the CreditCalc function:

enter image description here

Notice the gap between lines 123 and 125 ? This strange JavaScript code is for my eyes, and from what I see, the code that sits in this β€œfloating” object on line 125 will never hit, it just exists, but will never serve the purpose, it should be scary for you.

Strange constructs like these float all your scripts along with other errors that could potentially lead to unexpected behavior, for example, using != 0 instead of !== 0 .

So, I'm afraid there is no easy answer here, you probably have to do a lot of cleaning before Acrobat DC lets you run this form.

+4
source

Source: https://habr.com/ru/post/1264523/


All Articles