I found this code to place text on a page at a particular position.
ColumnText ct = new ColumnText(cb);
Phrase myText = new Phrase("TEST paragraph\nNewline");
ct.SetSimpleColumn(myText, 34, 750, 580, 317, 15, Element.ALIGN_LEFT);
ct.Go();
Now I wish to do so in a forlooop for a series of text. I have
columnText ct = new ColumnText(cb)
Phrase myText; int x = 34; int y = 750;
for(int i = 0; i<5; i++){
myText = new Phrase("TEST paragraph\nNewline");
ct.SetSimpleColumn(myText, x, y, 580, 317, 15, Element.ALIGN_LEFT);
ct.Go();
x += 10;
y+= 12;
}
But this gives me an error as the document fails to create.
How can I do this please?
Try moving the object creation into the loop: