本文整理汇总了C#中iTextSharp.text.Paragraph.SetLeading方法的典型用法代码示例。如果您正苦于以下问题:C# Paragraph.SetLeading方法的具体用法?C# Paragraph.SetLeading怎么用?C# Paragraph.SetLeading使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iTextSharp.text.Paragraph
的用法示例。
在下文中一共展示了Paragraph.SetLeading方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetParagraph
public static Paragraph GetParagraph(string text, Fonts type, int align = Element.ALIGN_LEFT)
{
Paragraph p;
switch (type)
{
case Fonts.Footer:
p = new Paragraph(text, FooterFont);
break;
case Fonts.ExtraLarge:
p = new Paragraph(text, ExtraLargeFont);
break;
case Fonts.Large:
p = new Paragraph(text);
break;
case Fonts.Compact:
p = new Paragraph(text, StandardFont);
p.SetLeading(0, 0.8f);
break;
case Fonts.Standard:
p = new Paragraph(text, StandardFont);
break;
default: throw new ArgumentOutOfRangeException("type");
}
p.Alignment = align;
return p;
}
示例2: AddParagraph
public static void AddParagraph(Document doc, int alignment, iTextSharp.text.Font font, iTextSharp.text.IElement content)
{
Paragraph paragraph = new Paragraph();
paragraph.SetLeading(0f, 1.2f);
paragraph.Alignment = alignment;
paragraph.Font = font;
paragraph.Add(content);
doc.Add(paragraph);
}
示例3: SetParagraphLeading
private static void SetParagraphLeading(Paragraph p, String leading) {
if (leading == null) {
p.SetLeading(0, 1.5f);
return;
}
try {
StringTokenizer tk = new StringTokenizer(leading, " ,");
String v = tk.NextToken();
float v1 = float.Parse(v, System.Globalization.NumberFormatInfo.InvariantInfo);
if (!tk.HasMoreTokens()) {
p.SetLeading(v1, 0);
return;
}
v = tk.NextToken();
float v2 = float.Parse(v, System.Globalization.NumberFormatInfo.InvariantInfo);
p.SetLeading(v1, v2);
}
catch {
p.SetLeading(0, 1.5f);
}
}
示例4: generarPdf
//.........这里部分代码省略.........
barcode.Data = sbCadenaQRCode.ToString();
barcode.ModuleSize = 3;
barcode.LeftMargin = 0;
barcode.RightMargin = 10;
barcode.TopMargin = 0;
barcode.BottomMargin = 0;
barcode.Encoding = BarcodeLib.Barcode.QRCode.QRCodeEncoding.Auto;
barcode.Version = BarcodeLib.Barcode.QRCode.QRCodeVersion.Auto;
barcode.ECL = BarcodeLib.Barcode.QRCode.ErrorCorrectionLevel.L;
bytesQRCode = barcode.drawBarcodeAsBytes();
}
#endregion
Image imageQRCode = Image.GetInstance(bytesQRCode);
imageQRCode.Alignment = (Image.TEXTWRAP | Image.ALIGN_LEFT);
imageQRCode.ScaleToFit(90f, 90f);
imageQRCode.IndentationLeft = 9f;
imageQRCode.SpacingAfter = 9f;
imageQRCode.BorderColorTop = Color.WHITE;
cel = new Cell(imageQRCode);
cel.VerticalAlignment = Element.ALIGN_MIDDLE;
cel.HorizontalAlignment = Element.ALIGN_CENTER;
cel.BorderColor = gris;
cel.BorderWidthTop = 0;
cel.BorderWidthRight = (float).5;
cel.BorderWidthLeft = 0;
cel.BorderWidthBottom = 0;
cel.Rowspan = 6;
adicional.AddCell(cel);
par = new Paragraph();
par.SetLeading(7f, 0f);
par.Add(new Chunk("SELLO DIGITAL DEL EMISOR\n", f5L));
par.Add(new Chunk(electronicDocument.Data.Sello.Value, f5).SetSplitCharacter(split));
cel = new Cell(par);
cel.BorderColor = gris;
cel.BorderWidthTop = 0;
cel.BorderWidthRight = 0;
cel.BorderWidthLeft = 0;
cel.BorderWidthBottom = (float).5;
cel.Colspan = 2;
adicional.AddCell(cel);
cel = new Cell(new Phrase("FOLIO FISCAL:", f5L));
cel.BorderColor = gris;
cel.BorderWidthTop = 0;
cel.BorderWidthRight = 0;
cel.BorderWidthLeft = 0;
cel.BorderWidthBottom = 0;
adicional.AddCell(cel);
cel = new Cell(new Phrase(objTimbre.Uuid.Value.ToUpper(), f5));
cel.BorderColor = gris;
cel.BorderWidthTop = 0;
cel.BorderWidthRight = 0;
cel.BorderWidthLeft = (float).5;
cel.BorderWidthBottom = 0;
adicional.AddCell(cel);
cel = new Cell(new Phrase("FECHA Y HORA DE CERTIFICACION:", f5L));
cel.BorderColor = gris;
cel.BorderWidthTop = (float).5;
cel.BorderWidthRight = 0;
cel.BorderWidthLeft = 0;
示例5: generarPdf
//.........这里部分代码省略.........
cellDesgloseMonto.HorizontalAlignment = PdfCell.ALIGN_RIGHT;
tableDesglose.AddCell(cellDesgloseRelleno);
tableDesglose.AddCell(cellDesgloseDescripcion);
tableDesglose.AddCell(cellDesgloseMonto);
}
document.Add(tableDesglose);
#endregion
#region "Desglose Detalle"
PdfPTable tableDesgloseDetalle = new PdfPTable(3);
int[] colWithsDesgloseDetalle = new int[3];
string colDesgloseDetalle = "8,8,84";
String[] arrColWidthDesgloseDetalle = colDesgloseDetalle.Split(new Char[] { ',' });
for (int i = 0; i < arrColWidthDesgloseDetalle.Length; i++)
{
colWithsDesgloseDetalle.SetValue(Convert.ToInt32(arrColWidthDesgloseDetalle[i]), i);
}
tableDesgloseDetalle.SetWidths(colWithsDesgloseDetalle);
tableDesgloseDetalle.WidthPercentage = 100F;
#endregion
#region "Creación e Inserción de Chunks en Paragraph"
Paragraph pFooter = new Paragraph();
pFooter.KeepTogether = true;
pFooter.Alignment = PdfCell.ALIGN_LEFT;
pFooter.SetLeading(1.6f, 1.6f);
//AZUL Font fontLbl = new Font(Font.HELVETICA, 6, Font.BOLD, new Color(43, 145, 175));
Font fontLbl = new Font(Font.HELVETICA, 6, Font.BOLD, new Color(25, 71, 6));
Font fontVal = new Font(Font.HELVETICA, 6, Font.NORMAL);
string cantidadLetra = dtConfigFact.Rows[0]["cantidadLetra"].ToString();
Chunk cCantidadLetraVal = new Chunk(cantidadLetra, new Font(Font.HELVETICA, 7, Font.BOLD));
Chunk cTipoComprobanteLbl = new Chunk("Tipo de Comprobante: ", fontLbl);
Chunk cTipoComprobanteVal = new Chunk(electronicDocument.Data.TipoComprobante.Value, fontVal);
Chunk cFormaPagoLbl = new Chunk("Forma de Pago: ", fontLbl);
Chunk cFormaPagoVal = new Chunk(electronicDocument.Data.FormaPago.Value, fontVal);
Chunk cMetodoPagoLbl = new Chunk("Método de Pago: ", fontLbl);
Chunk cMetodoPagoVal = new Chunk(electronicDocument.Data.MetodoPago.Value, fontVal);
Chunk cMonedaLbl = new Chunk("Moneda: ", fontLbl);
Chunk cMonedaVal = new Chunk(electronicDocument.Data.Moneda.Value, fontVal);
if (electronicDocument.Data.TipoCambio.Value.Length == 0)
electronicDocument.Data.TipoCambio.Value = "1";
Chunk cTasaCambioLbl = new Chunk("Tasa de Cambio: ", fontLbl);
Chunk cTasaCambioVal = new Chunk(Convert.ToDouble(electronicDocument.Data.TipoCambio.Value).ToString("C", _ci), fontVal);
Chunk cCertificadoLbl = new Chunk("Certificado del Emisor: ", fontLbl);
Chunk cCertificadoVal = new Chunk(electronicDocument.Data.NumeroCertificado.Value, fontVal);
Chunk cCadenaOriginalLbl = new Chunk("Cadena Original", fontLbl);
Chunk cCadenaOriginalVal = new Chunk(electronicDocument.FingerPrint, fontVal);
示例6: Read
protected override Stream Read()
{
Document doc = new Document(PageSize.A4, 50, 50, 50, 50);
doc.AddTitle(Title);
doc.AddCreationDate();
doc.AddCreator("iTextSharp");
doc.AddAuthor("文化中国");
doc.AddSubject(f.Brief);
using (MemoryStream stream = new MemoryStream())
{
PdfWriter writer = PdfWriter.GetInstance(doc, stream);
writer.SetEncryption(true, null, null, PdfWriter.ALLOW_PRINTING);
writer.ViewerPreferences = PdfWriter.PageModeUseOutlines;
writer.PageEvent = new HeaderFooterPdfPageEventHelper();
doc.Open();
foreach (var w in f.Webcasts.Where(w => w.Script != null).OrderBy(w => w.Aired))
{
Paragraph p = new Paragraph(w.Title, font);
p.Alignment = 1;
Chapter chapter = new Chapter(p, 1);
chapter.NumberDepth = 0;
chapter.BookmarkTitle = w.Title;
chapter.TriggerNewPage = true;
doc.Add(chapter);
MatchCollection matches = regex.Matches(w.Script.Text);
foreach (Match m in matches)
{
Chunk chunk = new Chunk(m.Groups["cont"].Value);
switch (m.Groups["tag"].Value.ToLower())
{
case "h1":
font.Color = BaseColor.WHITE;
chunk.SetBackground(BaseColor.DARK_GRAY);
break;
case "p":
font.Color = BaseColor.BLACK;
break;
}
chunk.Font = font;
p = new Paragraph(chunk);
p.SetLeading(0.0f, 2.0f);
p.FirstLineIndent = 20f;
p.Alignment = 0;
doc.Add(p);
}
}
doc.Close();
return new MemoryStream(stream.GetBuffer());
}
}
示例7: InsertPictureTitle
// 函数描述: 格式化报告的标题----
public static Paragraph InsertPictureTitle(string text)
{
var font = BaseFontAndSize("华文中宋", 12, Font.NORMAL);
var paragraph = new Paragraph(text, font)
{
Alignment = Element.ALIGN_CENTER,
SpacingBefore = 5,
SpacingAfter = 5
};
paragraph.SetLeading(1, 2);
return paragraph;
}
示例8: KrijoRaportin
//.........这里部分代码省略.........
rezultatiVerifikimit = "Nenshkrimi u verifikua me sukses.";
img = ImgOK;
}
else
{
rezultatiVerifikimit = "Nuk u verifikua nenshkrimi digjital.";
img = ImgNot;
}
img.ScaleAbsolute(25, 25);
CreateCell(tblDokumenti, "", 1, 0, false, new BaseColor(255, 255, 255), null, img);
CreateCell(tblDokumenti, rezultatiVerifikimit, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, "Koha e verifikimit", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, dokumenti.KohaVerifikimit.ToString(), 2, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, "Emri i dokumentit", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, dokumenti.Emri, 2, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, "Vlera hash e dokumentit (SHA256)", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, dokumenti.VleraHashString, 2, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, "Madhesia e dokumentit", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, dokumenti.Madhesia, 2, 0, false, new BaseColor(255, 255, 255));
doc.Add(tblDokumenti);
foreach(Nenshkrim nenshkrimi in dokumenti.Nenshkrimet)
{
PdfPTable tblNenshkruesi = new PdfPTable(2);
tblNenshkruesi.SpacingAfter = 20;
CreateCell(tblNenshkruesi, "Te dhenat e nenshkruesit", 2, 0, true, new BaseColor(66, 139, 202), new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Nenshkruesi", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.Nenshkruesi, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Emri", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.Emri, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Mbiemri", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.Mbiemri, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Data e nenshkrimit", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.DataNenshkrimit.ToString(), 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Algoritmi i Hashit", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.AlgoritmiHash, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Algoritmi i Enkriptimit", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.AlgoritmiEnkriptimit, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Certifikata valide prej", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.CertifikataValidePrej, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Certifikata valide deri", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.CertifikataValideDeri, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Numri serik i certifikates", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.SerialNumber, 1, 0, false, new BaseColor(255, 255, 255));
doc.Add(tblNenshkruesi);
PdfPTable tblIssuer = new PdfPTable(2);
CreateCell(tblIssuer, "Te dhenat e leshuesit te certifikates", 2, 0, true, new BaseColor(66, 139, 202), new BaseColor(255, 255, 255));
CreateCell(tblIssuer, "Emri(CN)", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblIssuer, nenshkrimi.IssuerCN, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblIssuer, "Njesia organizative(OU)", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblIssuer, nenshkrimi.IssuerOU, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblIssuer, "Organizata(O)", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblIssuer, nenshkrimi.IssuerO, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblIssuer, "Shteti(C)", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblIssuer, nenshkrimi.IssuerC, 1, 0, false, new BaseColor(255, 255, 255));
tblIssuer.SpacingAfter = 20;
doc.Add(tblIssuer);
}
//vije horizontale
Paragraph line = new Paragraph(doc.Bottom, new Chunk(new iTextSharp.text.pdf.draw.LineSeparator(0.0F, 100.0F, BaseColor.BLACK, Element.ALIGN_LEFT, 1)));
line.SpacingAfter = 0f;
doc.Add(line);
//footer
string shenim = "Shenim: Bazuar ne Ligjin Per Sherbimet e Shoqerise Informatike, Neni 1 - Përcakton dokumentacionin në formë elektronike juridikisht të barabartë me dokumentacionin tradicional të paraqitur në format të letrës.";
Paragraph footer = new Paragraph(shenim, new Font(Font.FontFamily.UNDEFINED, 8, Font.NORMAL, new BaseColor(32, 32, 32)));
footer.SetLeading(12f, 0);
footer.SpacingBefore = 0f;
doc.Add(footer);
doc.Close();
return ms;
}
示例9: CreateReport
//.........这里部分代码省略.........
rezultatiVerifikimit = "Signature verification successful.";
img = ImgOK;
}
else
{
rezultatiVerifikimit = "Signature verification failed.";
img = ImgNot;
}
img.ScaleAbsolute(25, 25);
CreateCell(tblDokumenti, "", 1, 0, false, new BaseColor(255, 255, 255), null, img);
CreateCell(tblDokumenti, rezultatiVerifikimit, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, "Verification date and time", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, dokumenti.KohaVerifikimit.ToString(), 2, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, "Name of signed file", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, dokumenti.Emri, 2, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, "Hash value of signed data (SHA256)", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, dokumenti.VleraHashString, 2, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, "Size of signed file", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblDokumenti, dokumenti.Madhesia, 2, 0, false, new BaseColor(255, 255, 255));
doc.Add(tblDokumenti);
foreach (Nenshkrim nenshkrimi in dokumenti.Nenshkrimet)
{
PdfPTable tblNenshkruesi = new PdfPTable(2);
tblNenshkruesi.SpacingAfter = 20;
CreateCell(tblNenshkruesi, "Certificate information", 2, 0, true, new BaseColor(66, 139, 202), new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Signer", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.Nenshkruesi, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "First Name", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.Emri, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Last Name", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.Mbiemri, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Signing time", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.DataNenshkrimit.ToString(), 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Hash Algorithm", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.AlgoritmiHash, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Encryption Algorithm", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.AlgoritmiEnkriptimit, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Certificate valid from", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.CertifikataValidePrej, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Certificate valid to", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.CertifikataValideDeri, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, "Certificate serial number", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblNenshkruesi, nenshkrimi.SerialNumber, 1, 0, false, new BaseColor(255, 255, 255));
doc.Add(tblNenshkruesi);
PdfPTable tblIssuer = new PdfPTable(2);
CreateCell(tblIssuer, "Info of certificate issuer", 2, 0, true, new BaseColor(66, 139, 202), new BaseColor(255, 255, 255));
CreateCell(tblIssuer, "Name(CN)", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblIssuer, nenshkrimi.IssuerCN, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblIssuer, "Organizational unit(OU)", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblIssuer, nenshkrimi.IssuerOU, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblIssuer, "Organization(O)", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblIssuer, nenshkrimi.IssuerO, 1, 0, false, new BaseColor(255, 255, 255));
CreateCell(tblIssuer, "Country(C)", 1, 0, true, new BaseColor(255, 255, 255));
CreateCell(tblIssuer, nenshkrimi.IssuerC, 1, 0, false, new BaseColor(255, 255, 255));
tblIssuer.SpacingAfter = 20;
doc.Add(tblIssuer);
}
//vije horizontale
Paragraph line = new Paragraph(doc.Bottom, new Chunk(new iTextSharp.text.pdf.draw.LineSeparator(0.0F, 100.0F, BaseColor.BLACK, Element.ALIGN_LEFT, 1)));
line.SpacingAfter = 0f;
doc.Add(line);
//footer
string shenim = "Note: Based on the Law on Information Society Services, Article 1 - Defines electronic documentation identical to Its traditional Legally counterpart in paper format.";
Paragraph footer = new Paragraph(shenim, new Font(Font.FontFamily.UNDEFINED, 8, Font.NORMAL, new BaseColor(32, 32, 32)));
footer.SetLeading(12f, 0);
footer.SpacingBefore = 0f;
doc.Add(footer);
doc.Close();
return ms;
}
示例10: AddParagraph
/// <summary>
/// Add a paragraph object containing the specified element to the PDF document.
/// </summary>
/// <param name="doc">Document to which to add the paragraph.</param>
/// <param name="alignment">Alignment of the paragraph.</param>
/// <param name="font">Font to assign to the paragraph.</param>
/// <param name="content">Object that is the content of the paragraph.</param>
void AddParagraph(Document doc, int alignment, Font font, IElement content)
{
Paragraph paragraph = new Paragraph();
paragraph.SetLeading(0f, 1.2f);
paragraph.Alignment = alignment;
paragraph.Font = font;
paragraph.Add(content);
doc.Add(paragraph);
}
示例11: InsertSummaryParagraph
// 函数描述:格式化“摘要”二字----
public static Paragraph InsertSummaryParagraph(string text, int spaceNum)
{
var font = BaseFontAndSize("黑体", 12, Font.BOLD);
var paragraph = new Paragraph(text, font)
{
Alignment = Element.ALIGN_JUSTIFIED,
SpacingBefore = 1,
IndentationLeft = 0,
Font = {Size = 12},
FirstLineIndent = 20,
SpacingAfter = spaceNum
};
paragraph.SpacingBefore = spaceNum;
paragraph.SetLeading(1, 2); //设置行间距
paragraph.Alignment = Element.ALIGN_LEFT;
return paragraph;
}
示例12: InsertTopFootParagraph
// 函数描述:插入底部信息
public static Paragraph InsertTopFootParagraph(string text)
{
var font = BaseFontAndSize("华文中宋", 18, Font.BOLD);
var paragraph = new Paragraph(text, font)
{
FirstLineIndent = 16,
IndentationLeft = 0,
IndentationRight = 20,
SpacingBefore = 1,
SpacingAfter = 1
};
paragraph.SetLeading(1, 2);
//paragraph.IndentationLeft = 24;
paragraph.Alignment = Element.ALIGN_CENTER;
return paragraph;
}
示例13: InsertTopTitleContent
// 函数描述: 格式化报告的标题
public static Paragraph InsertTopTitleContent(string text)
{
var font = BaseFontAndSize("华文中宋", 26, Font.BOLD);
var paragraph = new Paragraph(text, font)
{
Alignment = Element.ALIGN_CENTER,
SpacingBefore = 5,
SpacingAfter = 5
};
paragraph.SetLeading(1, 1.3f);
return paragraph;
}
示例14: InsertTopCommonParagraph
// 函数描述:插入中间的信息----
public static Paragraph InsertTopCommonParagraph(string text)
{
var font = BaseFontAndSize("黑体", 14, Font.NORMAL);
var paragraph = new Paragraph(text, font)
{
FirstLineIndent = 16,
IndentationLeft = 130,
IndentationRight = 20,
SpacingBefore = 1,
SpacingAfter = 1
};
paragraph.SetLeading(1, 2.2f);
//paragraph.IndentationLeft = 24;
paragraph.Alignment = 0;
return paragraph;
}
示例15: InsertTitleContent
// 函数描述: 格式化报告的标题
public static Paragraph InsertTitleContent(string text, bool isHasColor = true)
{
var font = BaseFontAndSize("华文中宋", 16, Font.BOLD);
var font1 = BaseFontAndSize("华文中宋", 16, Font.BOLD,new BaseColor(0,162,234));
var paragraph = new Paragraph
{
FirstLineIndent = 24,
IndentationLeft = 20,
IndentationRight = 20,
SpacingBefore = 1,
SpacingAfter = 1
};
paragraph.SetLeading(1, 2);
paragraph.Alignment = Element.ALIGN_CENTER;
if (isHasColor)
{
var strList = text.Split('@');
for (var i = 0; i < strList.Length; i++)
{
var fo = i % 2 == 0 ? font : font1;
var ch = new Chunk(strList[i], fo);
paragraph.Add(ch);
}
}
else
{
var ch = new Chunk(text, font);
paragraph.Add(ch);
}
return paragraph;
}