本文整理汇总了C#中Paragraph.AddAll方法的典型用法代码示例。如果您正苦于以下问题:C# Paragraph.AddAll方法的具体用法?C# Paragraph.AddAll怎么用?C# Paragraph.AddAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paragraph
的用法示例。
在下文中一共展示了Paragraph.AddAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateDocument
protected override void GenerateDocument(Document doc, DocumentType docType, string addSheet, PdfWriter writer)
{
Font normalFontSmall = FontFactory.GetFont("Arial", 10, Font.NORMAL);
Font normalFontLarge = FontFactory.GetFont("Arial", 11, Font.NORMAL);
Font boldFontSmall = FontFactory.GetFont("Arial", 10, Font.BOLD);
Font boldFontLarge = FontFactory.GetFont("Arial", 11, Font.BOLD);
// Create a table with 3 columns
PdfPTable table = new PdfPTable(3);
table.WidthPercentage = 100;
// Define the table header
table.DefaultCell.Colspan = 3;
table.DefaultCell.Border = Rectangle.NO_BORDER;
table.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
table.AddCell(new Phrase("PERMIT TO WORK – HOT WORKS", FontFactory.GetFont("Arial", 18)));
// First Row to draw
// -----------------------------------------------------------------------------------------
// |Applicable to: |
// |HOT WORK: All operations involving flame , spark or heat sufficient to start a fire |
// -----------------------------------------------------------------------------------------
table.DefaultCell.Border = Rectangle.BOX;
table.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
Paragraph paragraph = new Paragraph();
ArrayList arrayList = new ArrayList();
arrayList.Add(new Phrase("Applicable to:\n", boldFontSmall));
arrayList.Add(new Phrase("HOT WORK:", boldFontSmall));
arrayList.Add(new Phrase(" All operations involving flame , spark or heat sufficient to start a fire", normalFontSmall));
paragraph.AddAll(arrayList);
table.AddCell(paragraph);
// -----------------------------------------------------------------------------------------------------------------------------------
// |N.B Work specified in the Permit is conditional on all contractors/workers having signed and understood the West Gate Maintenance|
// |Health & Safety |
// |Contractor Guidelines and duly completed the company competence questionnaire |
// -----------------------------------------------------------------------------------------------------------------------------------
table.AddCell(new Paragraph("N.B Work specified in the Permit is conditional on all contractors/workers having signed and understood the West Gate Maintenance \n" +
"Health & Safety\n" +
"Contractor Guidelines and duly completed the company competence questionnaire", normalFontSmall));
// |-------------------------------------------------------------------------|
// |SECTION 1 - TO BE COMPLETED BY THE WEST GATE MAINTENANCE LTD SUPERVISOR |
// |-------------------------------------------------------------------------|
table.DefaultCell.VerticalAlignment = Element.ALIGN_MIDDLE;
table.AddCell(new Paragraph("SECTION 1 - TO BE COMPLETED BY THE " + companyName + " SUPERVISOR", boldFontLarge));
// |-------------------------------------------------------------------------|
// Details of Work and Personnel Date: |
// |-------------------------------------------------------------------------|
table.DefaultCell.FixedHeight = 25;
table.DefaultCell.VerticalAlignment = Element.ALIGN_TOP;
table.DefaultCell.Colspan = 2;
table.DefaultCell.Border = Rectangle.LEFT_BORDER;
table.AddCell(new Paragraph("Details of Work and Personnel", normalFontSmall));
table.DefaultCell.Border = Rectangle.RIGHT_BORDER;
table.AddCell(new Paragraph("Date:", normalFontSmall));
// |-------------------------------------------------------------------------|
// Authorised Person (Print Name) |
// |-------------------------------------------------------------------------|
table.DefaultCell.Border = Rectangle.BOX;
table.DefaultCell.Colspan = 3;
table.DefaultCell.FixedHeight = 0;
table.AddCell(new Paragraph("Authorised Person (Print Name)", boldFontLarge));
// |-------------------------------------------------------------------------|
// |Timescale: P.T.W. Issued |From: |To: |
// |-------------------------------------------------------------------------|
table.DefaultCell.Colspan = 1;
table.DefaultCell.FixedHeight = 0;
table.DefaultCell.VerticalAlignment = Element.ALIGN_MIDDLE;
table.AddCell(new Paragraph("Timescale: P.T.W. Issued", normalFontSmall)); table.AddCell(new Paragraph("From:", normalFontSmall)); table.AddCell(new Paragraph("To:", normalFontSmall));
// |-------------------------------------------------------------------------|
// |Work Method: |
// |-------------------------------------------------------------------------|
table.DefaultCell.Colspan = 3;
table.DefaultCell.FixedHeight = 25;
table.DefaultCell.VerticalAlignment = Element.ALIGN_TOP;
table.AddCell(new Paragraph("Work Method:", normalFontLarge));
// Two Empty rows
table.AddCell(""); table.AddCell("");
// |-------------------------------------------------------------------------|
// |Mandatory Safety Requirements: |
// |-------------------------------------------------------------------------|
PdfPCell cell = new PdfPCell(new Paragraph("Mandatory Safety Requirements:", normalFontLarge));
cell.BorderWidthTop = 1f;
cell.Colspan = 3;
table.AddCell(cell);
// |----------------------------------------------------------------------------------------------------------------|
// |1. All areas to be checked and combustibles removed or protected before commencement of work. |
// |2. All areas to be screened, protected and warning notices displayed before commencement of work |
// |3. Hand held extinguishers (appropriate to the task) within easy reach and operative be competent in their use.|
// |4. Area to be inspected for combustion on completion of work and 60 minutes after. |
//.........这里部分代码省略.........