I am facing an issue with converting a string from a file attached to my PDF (JSONTEST.txt) into JSON format so that I can reference it using obj[key]. Despite trying to use eval(), I encounter the following error every time:
SyntaxError: missing ; before statement
5:Document-Level:jsontest
Here is the script I am currently using:
console.show(); console.clear();
var oFile = this.getDataObjectContents("JSONTEST.txt");
var cFile = util.stringFromStream(oFile, "utf-8");
var obj = eval(cFile);
What could be causing this error and how can I rectify it? Once resolved, will I be able to reference it as intended?