"createDataObject" in Adobe reader
Hi All,
I am writing a script to spell check and create a log report in the adobe reader. My script works in acrobat pro. But in adobe reader its showing security error and per documentation we need "F" security level. is there is any alternate method to write a log as text file in acrobat reader
my script
function Spell_Check()
{
var chWord, numWords;
var Report;
for (var i = 0; i < this.numPages; i++)
{
numWords = this.getPageNumWords(i);
for (var j = 0; j < numWords; j++) {
ckWord = spell.checkWord(this.getPageNthWord(i,j))
if (ckWord != null) {
this.addAnnot({
page: i,
type: "Squiggly",
quads: this.getPageNthWordQuads(i,j),
author: "A.C.Acrobat",
//contents: ckWord.toString()
contents: (this.getPageNthWord(i,j))
});
Report = Report + "\t" + i + "\t" + (this.getPageNthWord(i,j)) +"\r\n";
}
}
}/* Put script title here */
myReport(Report);
}
var myReport = app.trustedFunction(function(Report)
{
//app.alert(Report);
app.beginPriv();
this.createDataObject({cName: "Report.txt", cValue: Report});
this.exportDataObject({cName: "Report.txt", nLaunch:0});
app.endPriv();
});
Thanks,
Balav
