iTextSharp – 添加垂直文本框

有谁知道是否可以使用itextsharp将垂直文本框添加到PDF文档。

我先尝试过旋转页面

PdfDictionary pDict = reader.GetPageN(1); pDict.Put(PdfName.ROTATE, new PdfNumber(90)); AddTextBox(stamper, ...........) // Rotate back 

但这只是水平添加文本框,我需要在旋转后获得另一个压模实例吗?

在创建TextField设置其Rotation属性:

 PdfReader reader = new PdfReader(file1); using (FileStream fs = new FileStream(file2, FileMode.Create, FileAccess.Write, FileShare.None)) { using (PdfStamper stamper = new PdfStamper(reader, fs)) { TextField tf = new TextField(stamper.Writer, new iTextSharp.text.Rectangle(0, 0, 100, 300), "Vertical"); //Change the orientation of the text tf.Rotation = 90; stamper.AddAnnotation(tf.GetTextField(), 1); } }