旋转文本/垂直于文字iTextSharp的

编程入门 行业动态 更新时间:2024-10-23 00:28:19
本文介绍了旋转文本/垂直于文字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的

本文发布于:2023-11-13 01:51:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1583090.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本   文字   iTextSharp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!