我有一个段落,它在我的pdf上渲染得很好:
var para = currentSection.AddParagraph();
para.AddText("My text.")
RenderObject(docRenderer, XUnit.FromCentimeter(1.27), XUnit.FromCentimeter(22.86), "4cm", myParagraph);事情是这样的,我想垂直书写这段文字。
如何使用Migradoc和/或PdfSharp实现这一点?
发布于 2017-11-27 23:55:24
我做到了(感谢PDFsharp新手和Mong Zhu)。下面是代码,以防其他人想要编写竖排文本:
XForm form = new XForm(this.currentGfx, XUnit.FromMillimeter(70), XUnit.FromMillimeter(55));
XGraphics formGfx = XGraphics.FromForm(form);
formGfx.DrawString("Test text", new XFont("Verdana", 6, XFontStyle.Regular), XBrushes.Black, 3, 0, XStringFormats.TopLeft);
currentGfx.Dispose();
currentGfx = XGraphics.FromPdfPage(this.currentPage);
currentGfx.RotateAtTransform(270, new XPoint(15, 773));
currentGfx.DrawImage(form, 15, 773, 200, 200);https://stackoverflow.com/questions/47513744
复制相似问题