本文整理匯總了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);
}