views:

460

answers:

1

In itext I have a chunk/phrase/paragraph (I dont mind which) and I want to position some where else on the page e.g. at 300 x 200. How would I do this?

+1  A: 

In the end I wrote my own method to do it.

private void PlaceChunck(string text, int x, int y) {
        PdfContentByte cb = writer.DirectContent;
        BaseFont bf = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
        cb.SaveState();
        cb.BeginText();
        cb.MoveText(x, y);
        cb.SetFontAndSize(bf, 12);
        cb.ShowText(text);
        cb.EndText();
        cb.RestoreState();
    }
Jack
Hi. Does it support newlines?
karolrvn