J'ai suivi les échantillons iText pour le texte vertical:iTextSharp et VerticalText
http://1t3xt.info/examples/browse/?page=example&id=145
et a créé cette version C# de celui-ci:
PdfReader reader = new PdfReader("existing.pdf");
PdfStamper stamp = new PdfStamper(reader, new FileStream("stamped.pdf", FileMode.Create));
// change the content on top of page 1
PdfContentByte cb = stamp.GetOverContent(1);
Rectangle psize = reader.GetPageSize(1);
float width = psize.Width;
float height = psize.Height;
BaseFont bf = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
VerticalText vt = new VerticalText(cb);
vt.SetVerticalLayout(width/2, height/2, height, 1, 0);
vt.AddText(new Phrase("Test", new Font(bf, 20)));
vt.Go();
stamp.Close();
Il est centré sur la page, d'accord, mais n'est pas vertical - mais horizontal (aligné à gauche horizontalement depuis le centre de la page).
Est-ce que je fais quelque chose de mal ici ou est-ce que iTextSharp se comporte mal?
PS: L'exemple a été déplacé (ou lancé et remplacé ailleurs): http://itextpdf.com/examples/iia.php?id=202 –