当前位置: 首页>>代码示例>>C#>>正文


C# Paragraph.AddAll方法代码示例

本文整理汇总了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.                             |
//.........这里部分代码省略.........
开发者ID:ali-codehoppers,项目名称:unchsunchs,代码行数:101,代码来源:HotWorksGenerator.cs


注:本文中的Paragraph.AddAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。