PdfLayer stampLayer = new PdfLayer("PdfStampLayer", stamp.Writer); for (int i = 1; i <= pdfReader.NumberOfPages; i++) // Must start at 1 because 0 is not an actual page. { // change the content on top of page 1 PdfContentByte cb = stamp.GetOverContent(i); cb.BeginLayer(stampLayer); Rectangle psize = pdfReader.GetPageSize(i); float width = psize.Width; float height = psize.Height; BaseFont bf = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED); VerticalText vt = new VerticalText(cb); //NX D size drawing stamping vt.SetVerticalLayout(width - 150, height - 68, height, 1, 0); vt.AddText(new Phrase("SAMPLE", new Font(bf, 13))); vt.Go(); vt.SetVerticalLayout(width - 250, height - 68, height, 1, 0); vt.AddText(new Phrase("34567", new Font(bf, 13))); vt.Go(); cb.EndLayer(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)