Copy link to clipboard
Copied
TypeError: f is null
1051:byteCodeTool
That's the error I'm getting. The main problem is I have 88 fields being calculated. Is there a way to more easily find the source of this than to dig through each field?
1 Correct answer
Go to Edit - Preferences - JavaScript and select an external editor, like Notepad.exe ...
Copy link to clipboard
Copied
HI,
With the form open, search the tools for "All JavaScripts", this will open every JavaScript in the document in one file, DO NOT CHANGE this as it is very easy to break the document. Once you have located what you think is the problem you should go to the form field and make the change there.
Regards
Malcolm
Copy link to clipboard
Copied
Sadly, that gives me a popup.
Text cannot be display in full by the Edit Dialog.
Please use an External Editor.
Not an overly helpful popup.
Oh, and javascript, lots of javascript. Large arrays and for loops, mostly.
Copy link to clipboard
Copied
Did you create this form and the scripts?
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
I created the fields and javascript from a base pdf version of a form which was originally intended to be printed and filled in by hand.
Copy link to clipboard
Copied
Go to Edit - Preferences - JavaScript and select an external editor, like Notepad.exe ...
Copy link to clipboard
Copied
Very helpful. Thank you. ^_^ The specific error sadly isn't in my code so much as a field format issue, from the searches on the specific one, but this helped me find another that cropped up as I was tweaking.
Copy link to clipboard
Copied
So "f" must be script variable that is set from "getField"? And you use it in the custom calculation script in all 88 fields?
Or, are you using simplified field notation for the calculation? I ask this because the error is reported on line 1051 of a script called the "byteCodeTool". This implies there is an error in translating code. This is important for understanding the context of the error.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
I always keep Acrobat 9 Pro on my Mac for 2 reasons:
- The JavaScript Console of Acrobat 9 and older versions gives the field name source of error.
- It's faster and more efficient (no crash) for batch process.
I guess that Adobe Reader 9 should be enought to display errors in the JavaScript Console (don't forget to enable the debugger in JavaScript Preferences).
Acrobate du PDF, InDesigner et Photoshoptographe

