如何在itextsahrp中旋转多行文本?使用Columntext旋转多行文本ITextSharp
我曾尝试:
float x = 200;
float y = 100;
PdfContentByte cb = stamper.GetOverContent(i);
ColumnText ct = new ColumnText(cb);
ct.SetSimpleColumn(new Phrase(new Chunk("Test \n new", FontFactory.GetFont(FontFactory.HELVETICA, 18, iTextSharp.text.Font.NORMAL))),
x, reader.GetCropBox(i).Height -(y+400),500+x, y, 10, Element.ALIGN_LEFT | Element.ALIGN_TOP);
ct.Go();
ColumnText.ShowTextAligned(
cb, Element.ALIGN_CENTER,
new Phrase(new Chunk("Test \n new", FontFactory.GetFont(FontFactory.HELVETICA, 18, iTextSharp.text.Font.NORMAL))), x, reader.GetCropBox(i).Height-y, 12);
ct.SetSimpleColumn
显示multilie文字,但我怎么转动的?
ColumnText.ShowTextAligned
不显示多行。
我已经在回答你以前的问题时解释了这个问题:不是将'ColumnText'添加到'stamper.GetOverContent(i)'中,而是使用'PdfTemplate'对象创建一个Form XObject。将'ColumnText'添加到'PdfTemplate'中,并使用接受参数来旋转模板的'AddTemplate()'方法将该模板添加到'stamper.GetOverContent(i)'中。 – 2014-09-12 12:45:02