本文介绍了旋转文本/垂直于文字iTextSharp的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要垂直文本或只是一种旋转iTextSharp的一个ColumnText。
I need vertical text or just a way to rotate a ColumnText in ITextSharp.
(它需要绝对位置)
到现在为止我已经尝试了很多不同势解决方案,但没有运气
Until now i have tried a lot of diffrent solution, but with no luck.
下面是一对夫妇尝试的:
Here is a couple of tries:
1
_cb.SetFontAndSize(BaseFont.CreateFont(), 12f); _cb.ShowTextAligned(Element.ALIGN_CENTER, "Hello World", 50, 50, 90);
2
2.
var vt = new VerticalText(_cb); vt.SetVerticalLayout(50, 50, 400, 8, 30); vt.AddText(new Chunk("asdasd",_sf.ChildBackPageTextOneFont())); vt.Go();
3。
3.
System.Drawing.Drawing2D.Matrix foo = new System.Drawing.Drawing2D.Matrix(); foo.Rotate(90); _cb.ConcatCTM(foo);
我也试图与System.Drawing.Graphics绘制,但质量很差。
I have also tried to draw it with System.Drawing.Graphics, but the quality is VERY poor.
任何解决方案?谢谢
推荐答案找到了答案:
使用这样的事情
Imports System.Drawing, System.Drawing.Drawing2D Dim transf as new Matrix transf.RotateAt(30,New PointF(100,100), MatrixOrder.Append) writer.DirectContent.Transform(transf) transf.Invert() writer.DirectContent.Transform(transf)旋转画布,写一些文字,旋转回来。
Rotate the canvas, write some text, rotate it back.
更多推荐
旋转文本/垂直于文字iTextSharp的
发布评论