2 Replies Latest reply on Jan 10, 2017 1:22 PM by Jo_2013

    Get all words on a page and report to the console

    Jo_2013 Level 1

      I have a script which finds all words in a pdf and reports these words back to the console in separate lines for each word.

      Console report:

       

      TRESTLE

      FOOTING

      BUILDING

      DETAILS

      FOR

      PROJECT

      X

       

      The script needs to be modified to report all words found back to the console in a single line (one sentence) with a space between each word.

       

      If anyone can please provide assistance this will be most appreciated, script as follows:

       

      var ckWord, numWords;

      for (var i = 0; i < this.numPages; i++ )

      {

      numWords = this.getPageNumWords(i);

      for (var j = 0; j < numWords; j++)

      {

      ckWord = this.getPageNthWord(i, j)

      if ( ckWord != null )

      {

      console.println(ckWord);

      }

      }

      }