iTextSharp中心对齐Document对象中的对象 [英] iTextSharp center align objects within the Document object

查看:135
本文介绍了iTextSharp中心对齐Document对象中的对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种快速简单的方法来对齐Document对象中的对象? 没有执行任何计算逻辑,即。获取页面宽度,获取内容宽度,除以2等。

Is there a quick and simple way to center align objects within the Document object? Without performing any calculation logic, ie. Get width of page, get width of contents, divide by two, etc.

我在Document对象中的Paragraph对象中有一个PdfPTable对象。我想将Paragraph对象居中。

I have a PdfPTable object within a Paragraph object, within the Document object. I would like to center the Paragraph object.

谢谢!

推荐答案

PDFPTable.HorizontalAlignment = Element.ALIGN_CENTER;

这篇关于iTextSharp中心对齐Document对象中的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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