本文整理汇总了C#中iTextSharp.text.Paragraph.SetAlignment方法的典型用法代码示例。如果您正苦于以下问题:C# Paragraph.SetAlignment方法的具体用法?C# Paragraph.SetAlignment怎么用?C# Paragraph.SetAlignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iTextSharp.text.Paragraph
的用法示例。
在下文中一共展示了Paragraph.SetAlignment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetParagraph
public static Paragraph GetParagraph(Properties attributes)
{
Paragraph paragraph = new Paragraph(GetPhrase(attributes));
String value;
value = attributes[ElementTags.ALIGN];
if (value != null) {
paragraph.SetAlignment(value);
}
value = attributes[ElementTags.INDENTATIONLEFT];
if (value != null) {
paragraph.IndentationLeft = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
}
value = attributes[ElementTags.INDENTATIONRIGHT];
if (value != null) {
paragraph.IndentationRight = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
}
return paragraph;
}
示例2: OnStartPage
public override void OnStartPage(PdfWriter writer, Document document)
{
if (!_isDocumentClosing) {
_pageNumber++;
// ===========================================================================
// Create header column -- in this report this is the page's column object
// ===========================================================================
ct.SetSimpleColumn(PortraitPageSize.HdrLowerLeftX, PortraitPageSize.HdrLowerLeftY,
PortraitPageSize.HdrUpperRightX, PortraitPageSize.HdrUpperRightY,
PortraitPageSize.PgLeading, Element.ALIGN_CENTER);
ct.YLine = PortraitPageSize.HdrTopYLine;
// =======================================================
// Add Logo
// =======================================================
if (_pageNumber == 1) {
float[] wscLogoLayout = new float[] { 413F, 127F };
PdfPTable logoTable = PdfReports.CreateTable(wscLogoLayout, 0);
PdfReports.AddText2Table(logoTable, " ", normalFont);
PdfReports.AddImage2Table(logoTable, _imgLogo);
PdfReports.AddText2Table(logoTable, " ", titleFont, wscLogoLayout.Length);
PdfReports.AddTableNoSplit(document, this, logoTable);
}
float[] headerLayout = new float[] { 50F, 490F };
PdfPTable table = PdfReports.CreateTable(headerLayout, 1);
Paragraph p = new Paragraph(_title, titleFont);
p.SetAlignment("center");
PdfReports.AddText2Table(table, p, "center", headerLayout.Length);
// Add blank lines
PdfReports.AddText2Table(table, " ", subNormalFont, headerLayout.Length);
PdfReports.AddText2Table(table, " ", normalFont, headerLayout.Length);
// Add Header information
PdfReports.AddText2Table(table, "SHID", labelFont);
PdfReports.AddText2Table(table, "Shareholder Name", labelFont);
PdfReports.AddText2Table(table, _shid, normalFont);
PdfReports.AddText2Table(table, _shareholderName, normalFont);
PdfReports.AddText2Table(table, " ", normalFont, headerLayout.Length);
PdfReports.AddText2Table(table, " ", normalFont, headerLayout.Length);
PdfReports.AddTableNoSplit(document, this, table);
table = PdfReports.CreateTable(_primaryTableLayout, 0);
AddDetailSectionHdr(ref table, labelFont, normalFont);
PdfReports.AddTableNoSplit(document, this, table);
_headerBottomYLine = ct.YLine;
}
base.OnStartPage(writer, document);
}