旋转文本/垂直于文字iTextSharp的 [英] Rotate text / Vertical text in itextsharp

查看:1103
本文介绍了旋转文本/垂直于文字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的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆