当前位置: 首页> 财经> 股票 > 性能优化工具_公司装修办公楼_公司网站建设公司_南宁百度推广seo

性能优化工具_公司装修办公楼_公司网站建设公司_南宁百度推广seo

时间:2025/7/12 23:15:01来源:https://blog.csdn.net/nbspzs/article/details/143158091 浏览次数:0次
性能优化工具_公司装修办公楼_公司网站建设公司_南宁百度推广seo

在vsto、Aspose.Words 中,默认没有直接的 API 可以让表格整体旋转 90 度。然而,我们可以通过一些方式来实现类似的效果,具体思路如下:
将表格插入到一个形状(Shape)或文本框中,然后旋转该形状。
将表格内容旋转,这通过设置文本方向为垂直来模拟旋转效果。

using Aspose.Words;
using Aspose.Words.Tables;
using Aspose.Words.Drawing;class Program
{static void Main(){// 创建文档和 DocumentBuilderDocument doc = new Document();DocumentBuilder builder = new DocumentBuilder(doc);// 创建 Shape(文本框)Shape shape = new Shape(doc, ShapeType.TextBox);shape.Width = 200;  // 设置文本框的宽度shape.Height = 400; // 设置文本框的高度shape.WrapType = WrapType.None;// 旋转 Shape 90 度shape.Rotation = 90;// 将 Shape 添加到文档中builder.InsertNode(shape);// 创建一个新的 DocumentBuilder 用于 Shape 内部DocumentBuilder shapeBuilder = new DocumentBuilder(doc);shapeBuilder.MoveTo(shape.FirstParagraph);// 在 Shape 内部添加一个表格Table table = shapeBuilder.StartTable();shapeBuilder.InsertCell();shapeBuilder.Write("Cell 1");shapeBuilder.InsertCell();shapeBuilder.Write("Cell 2");shapeBuilder.EndRow();shapeBuilder.InsertCell();shapeBuilder.Write("Cell 3");shapeBuilder.InsertCell();shapeBuilder.Write("Cell 4");shapeBuilder.EndTable();// 保存文档doc.Save("RotatedTable.docx");}
}

关键字:性能优化工具_公司装修办公楼_公司网站建设公司_南宁百度推广seo

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: