Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 82585

Re: Add paragraphs with text

$
0
0

Hi Klaus,

 

just change your last line from

 

oDoc.NewSeriesPgf(pgf);  

 

to :

pgf = oDoc.NewSeriesPgf(pgf);  

 

that should do it.

So you directly point to the new pgf.

 

completely :

// write array to multiple paragraphs

      var items      = new Array ();

      var nItems, pgf, textLoc, oDoc; 

      items = ["Århus", "Çedille", "Dandy"];

      nItems = items.length;

      oDoc = app.ActiveDoc;

      

      pgf = oDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;  // get first pgf in flow

      for (var i = 0; i < nItems; i += 1) {

        textLoc = new TextLoc (pgf, 0);  

        insText = items[i];

        oDoc.AddText (textLoc, insText + "\x08" + insText); // \t inserts a NL...

 

       if (i < nItems -1){

        pgf = oDoc.NewSeriesPgf(pgf);                       // add a paragraph 

        }

      }


Viewing all articles
Browse latest Browse all 82585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>