Skip to main content
Balav483
Known Participant
March 4, 2019
Answered

"createDataObject" in Adobe reader

  • March 4, 2019
  • 2 replies
  • 1066 views

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

This topic has been closed for replies.
Correct answer try67

No, not really.

2 replies

Inspiring
March 4, 2019

About the best you can do is write the report string to a text field, the JavaScript console, or a text field in a custom dialog, and the user could manually copy & paste into a text editor, and then save.

try67
try67Correct answer
Community Expert
March 4, 2019

No, not really.