Exemplo n.º 1
0
        private void PageSettings(Section section)
        {
            Paragraph naglowek = section.Headers.Primary.AddParagraph();

            naglowek.Format.Font.Underline = Underline.Single;
            //  vugraph.tytul = "EJCH";
            naglowek.AddFormattedText("European Youth Bridge Championship");
            // string tekst = vugraph.tytul;

            //   if (tekst.Count() > 40)
            //        tekst = tekst.Substring(0, 40);

            naglowek.AddSpace(5);
            naglowek.AddImage("images\\mini_b24dwa.jpg");
            naglowek.AddSpace(10);
            naglowek.AddFormattedText(game.data.ToShortDateString());

            Paragraph stopka = section.Footers.Primary.AddParagraph();

            stopka.Format.Borders.Top.Width = Unit.FromCentimeter(0.1);
            stopka.AddFormattedText(mail);
            stopka.AddTab(); stopka.AddTab(); stopka.AddTab(); stopka.AddTab(); stopka.AddTab(); stopka.AddTab();
            stopka.Format.Alignment = ParagraphAlignment.Justify;
            stopka.AddFormattedText("Strona ");
            stopka.AddPageField();
            stopka.AddFormattedText(" z " + (Ustawienia.ilosc_rozdan + 2).ToString());
        }
Exemplo n.º 2
0
        private void PageSettings(Section section)
        {
            Paragraph naglowek = section.Headers.Primary.AddParagraph();

            naglowek.Format.Font.Underline = Underline.Single;

            naglowek.AddFormattedText("Trening licytacyjny");


            naglowek.AddSpace(22);
            naglowek.AddImage("images\\mini_b24dwa.jpg");
            naglowek.AddSpace(15);
            naglowek.AddFormattedText(DateTime.Now.ToShortDateString());


            Paragraph stopka = section.Footers.Primary.AddParagraph();

            stopka.Format.Borders.Top.Width = Unit.FromCentimeter(0.1);
            stopka.AddFormattedText(mail);
            stopka.AddTab(); stopka.AddTab(); stopka.AddTab(); stopka.AddTab(); stopka.AddTab(); stopka.AddTab();
            stopka.AddSpace(4);
            stopka.Format.Alignment = ParagraphAlignment.Justify;
            stopka.AddFormattedText("Strona ");
            stopka.AddPageField();
            stopka.AddFormattedText(" z " + (Ustawienia.ilosc_rozdan + 1).ToString());
        }
Exemplo n.º 3
0
        private void PageSettings(Section section)
        {
            Paragraph naglowek = section.Headers.Primary.AddParagraph();

            naglowek.Format.Font.Underline = Underline.Single;

            naglowek.AddFormattedText(vugraph1.tytul);
            string tekst = vugraph1.tytul;

            if (tekst.Count() > 40)
            {
                tekst = tekst.Substring(0, 40);
            }

            naglowek.AddSpace(40 - vugraph1.tytul.Count());
            naglowek.AddImage("images\\mini_b24dwa.jpg");
            naglowek.AddSpace(15);
            naglowek.AddFormattedText(DateTime.Now.ToShortDateString());


            Paragraph stopka = section.Footers.Primary.AddParagraph();

            stopka.Format.Borders.Top.Width = Unit.FromCentimeter(0.1);
            stopka.AddFormattedText(mail);
            stopka.AddTab(); stopka.AddTab(); stopka.AddTab(); stopka.AddTab(); stopka.AddTab(); stopka.AddTab();
            stopka.AddSpace(4);
            stopka.Format.Alignment = ParagraphAlignment.Justify;
            stopka.AddFormattedText("Strona ");
            stopka.AddPageField();
            stopka.AddFormattedText(" z " + (Ustawienia.ilosc_rozdan + 1).ToString());
        }
Exemplo n.º 4
0
        private void WriteLineKontrakt(InfoBoard board, InfoBoard board2)
        {
            Section   section = document.LastSection;
            Paragraph p       = section.AddParagraph();

            p.Format.Font = font_normal.Clone();
            p.AddLineBreak();
            p.AddFormattedText("Kontrakt  ");
            p = WriteContract(p, board);
            p.AddFormattedText(" ");
            p = WriteTricks(p, board.lew);
            p.AddFormattedText(", ");
            p = WriteLead(p, board);
            p.AddSpace(6);

            p = WriteScore(p, board.score);
            p.AddSpace(29);
            p.AddFormattedText("Kontrakt  ");
            p = WriteContract(p, board2);
            p.AddFormattedText(" ");
            p = WriteTricks(p, board2.lew);
            p.AddFormattedText(", ");
            p = WriteLead(p, board2);
            p.AddSpace(6);
            p = WriteScore(p, board2.score);
        }
Exemplo n.º 5
0
        public Section CreateDocumentSection()
        {
            Section section = _document.AddSection();

            // Set section footer
            Paragraph paragraph = new Paragraph();

            paragraph.Format.Font.Size   = 6;
            paragraph.Format.Alignment   = ParagraphAlignment.Right;
            paragraph.Format.Font.Italic = false;
            paragraph.Format.Font.Color  = Colors.DarkGray;
            paragraph.AddText($"Powered by {AppConstants.AppTitle} {AppConstants.AppVersion}");
            paragraph.AddSpace(3);
            paragraph.AddText("|");
            paragraph.AddSpace(3);
            paragraph.AddText(Phrases.GlobalPage);
            paragraph.AddSpace(1);
            paragraph.AddPageField();
            paragraph.AddSpace(1);
            paragraph.AddText(Phrases.GlobalOf);
            paragraph.AddSpace(1);
            paragraph.AddNumPagesField();

            section.Footers.Primary.Add(paragraph);
            section.Footers.EvenPage.Add(paragraph.Clone());

            return(section);
        }
Exemplo n.º 6
0
        private void WriteLineKontrakt(InfoBoard board, InfoBoard board2, InfoBoard board3)
        {
            Section   section = document.LastSection;
            Paragraph p       = section.AddParagraph();

            p.Format.Font = font_normal.Clone();
            p.AddLineBreak();
            p.AddFormattedText("Kontrakt  ");
            p = WriteContract(p, board);
            p.AddFormattedText(" ");
            p = WriteTricks(p, board.lew);
            p.AddFormattedText(", ");
            p = WriteLead(p, board);
            p.AddSpace(3);
            p = WriteScore(p, board.score);

            p.AddSpace(12);

            p.AddFormattedText("Kontrakt  ");
            p = WriteContract(p, board2);
            p.AddFormattedText(" ");
            p = WriteTricks(p, board2.lew);
            p.AddFormattedText(", ");
            if (Ustawienia.linoc)
            {
                p = WriteLead(p, board2);
            }
            else
            {
                p = WriteLead(p, board3);
            }
            p.AddSpace(3);
            p = WriteScore(p, board2.score);

            p.AddSpace(12);
            p.AddFormattedText("Kontrakt  ");
            p = WriteContract(p, board3);
            p.AddFormattedText(" ");
            p = WriteTricks(p, board3.lew);
            p.AddFormattedText(", ");
            if (Ustawienia.linoc)
            {
                p = WriteLead(p, board3);
            }
            else
            {
                p = WriteLead(p, board2);
            }
            p.AddSpace(3);
            p = WriteScore(p, board3.score);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Add a text frame.
        /// </summary>
        /// <param name="section"></param>
        private static void AddCodeBlock(Section section, string text)
        {
            Table table = section.AddTable();

            table.Borders.Width   = "0.5pt";
            table.Borders.Color   = MigraDoc.DocumentObjectModel.Colors.DarkGray;
            table.LeftPadding     = "5mm";
            table.Rows.LeftIndent = "0cm";

            var column = table.AddColumn();

            column.Width = Unit.FromMillimeter(180);

            Row row = table.AddRow();

            string[] lines = text.Split(new string[] { "\r\n" }, StringSplitOptions.None);

            foreach (string line in lines)
            {
                int       numSpaces = StringUtilities.IndexNotOfAny(line, " ".ToCharArray(), 0);
                Paragraph p         = row[0].AddParagraph();
                p.AddSpace(numSpaces);
                p.AddText(line);
                p.Style = "TableParagraph";
            }
        }
Exemplo n.º 8
0
        Paragraph WriteTableTitle(string team1, string team2, int nr)
        {
            Paragraph p = new Paragraph();

            p.Format.Font.Color = new Color(192, 80, 72);
            p.Format.Font.Bold  = true;
            p.Format.Font.Name  = "Cambria";
            p.Format.Font.Size  = 8;
            p.AddFormattedText("Mecz nr " + nr.ToString() + " :  ");
            p.AddFormattedText(team1);
            p.AddSpace(5);
            p.AddFormattedText("przeciwko");
            p.AddSpace(5);
            p.AddFormattedText(team2);
            p.AddLineBreak();
            p.AddLineBreak();

            return(p);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Adds fixed-width text to a MigraDoc paragraph
        /// </summary>
        /// <param name="paragraph">The paragaraph to add text to</param>
        /// <param name="text">The text</param>
        private static void AddFixedWidthText(Paragraph paragraph, string text, int width)
        {
            // For some reason, a parapraph converts all sequences of white
            // space to a single space.  Thus we need to split the text and add
            // the spaces using the AddSpace function.

            int numSpaces = width - text.Length;

            paragraph.AddSpace(numSpaces);
            paragraph.AddText(text);
        }
Exemplo n.º 10
0
        private Paragraph zrob_kolor(int idx, Paragraph p, string karty)
        {
            p.AddLineBreak();
            p.AddTab(); p.AddSpace(5);

            p.AddFormattedText(suits[idx].ToString(), znaki_kart[idx]);


            p.AddText(" " + karty);

            return(p);
        }
Exemplo n.º 11
0
        private static void addScopeBranch(TECScopeBranch branch, Document document, Paragraph paragraph, int tabs, string tabChar = "• ")
        {
            string scopeString = branch.Label;

            for (int i = 0; i < tabs; i++)
            {
                paragraph.AddTab();
            }
            paragraph.AddFormattedText(tabChar);
            if (tabChar != "• ")
            {
                paragraph.AddSpace(2);
            }
            paragraph.AddFormattedText(scopeString);

            foreach (TECScopeBranch childBranch in branch.Branches)
            {
                paragraph = document.LastSection.AddParagraph();
                addScopeBranch(childBranch, document, paragraph, (tabs + 1));
            }
        }
Exemplo n.º 12
0
        private static void createScope(Document document, TECBid bid)
        {
            Paragraph paragraph = document.LastSection.AddParagraph("Scope of Work:", "Heading2");

            paragraph.Format.SpaceBefore   = beforeParagraphSize;
            paragraph.Format.Shading.Color = Colors.LightGray;
            paragraph.AddLineBreak();

            int i = 0;

            foreach (TECScopeBranch branch in bid.ScopeTree)
            {
                paragraph = document.LastSection.AddParagraph();
                addScopeBranch(branch, document, paragraph, 0, (itemLetters[i] + "."));
                i++;
            }

            paragraph = document.LastSection.AddParagraph();
            paragraph.AddFormattedText(itemLetters[i] + ".");
            paragraph.AddSpace(2);
            paragraph.AddFormattedText("Provide a BMS and Automatic Temperature functions for the following mechanical systems:");
            paragraph.AddLineBreak();
            createSystemTree(document, bid);
        }
Exemplo n.º 13
0
        public void AddClientDetails(Section sec)
        {
            Table t = sec.AddTable();

            t.LeftPadding   = "0mm";
            t.RightPadding  = "0mm";
            t.TopPadding    = "0mm";
            t.BottomPadding = "0mm";

            Column c = t.AddColumn("1mm");

            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            c = t.AddColumn("29mm");
            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            c = t.AddColumn("1mm");
            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            c = t.AddColumn("158mm");
            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            c = t.AddColumn("1mm");
            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            Row r = t.AddRow();

            r.Height = "2mm";
            r.Cells[0].AddImage("C:\\images\\transpix.gif").Height = "1mm";
            // r.Cells[1].MergeDown = 2;
            r.Cells[1].Format.Alignment = ParagraphAlignment.Center;
            Image icn = new Image();

            r               = t.AddRow();
            r.Style         = "Heading3";
            r.TopPadding    = row_padding;
            r.BottomPadding = row_padding;

            Paragraph p = r.Cells[1].AddParagraph();

            p.AddSpace(4);
            p.AddText("Insurance Details");
            r.Cells[1].Shading.Color = table_color;
            r.Cells[0].Shading.Color = table_color;
            r.Cells[2].MergeRight    = 2;
            r.Cells[1].MergeRight    = 3;

            r        = t.AddRow();
            r.Height = "1mm";
            r.Cells[0].AddImage("C:\\images\\transpix.gif").Height = "1mm";
            r.Cells[2].MergeRight = 2;
            r.Cells[2].AddImage("C:\\images\\transpix.gif").Height = "1mm";
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            r = t.AddRow();
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;
            p = r.Cells[3].AddParagraph();
            p.AddFormattedText("G-BSHY", TextFormat.Bold);
            p.AddTab();
            p.AddTab();
            p.AddTab();
            p.AddFormattedText("Acrosport 1", TextFormat.Bold);
            p.AddTab();
            p.AddTab();
            p.AddTab();
            p.AddFormattedText("MTOM 1000 kgs", TextFormat.Bold);
            p.AddLineBreak();
            p.AddLineBreak();
            p.AddText("and a maximum of 1 passenger seats is engaged in Private Business and Pleasure Uses (as more fully defined in the Certificate Wording)");

            r = t.AddRow();
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            r = t.AddRow();
            p = r.Cells[1].AddParagraph();
            p.AddFormattedText("Insured By:", TextFormat.Bold);
            p.AddLineBreak();

            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            p = r.Cells[3].AddParagraph();
            p.AddText("Great Lakes Insurance SE a wholly owned subsidiary of the group Munich RE");
            // p.AddLineBreak();


            r = t.AddRow();
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            r = t.AddRow();
            p = r.Cells[1].AddParagraph();
            p.AddFormattedText("Under Policy No:", TextFormat.Bold);
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            p = r.Cells[3].AddParagraph();
            p.AddText("X09898");


            r = t.AddRow();
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            r = t.AddRow();
            p = r.Cells[1].AddParagraph();
            p.AddFormattedText("In the name of:", TextFormat.Bold);
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            p = r.Cells[3].AddParagraph();
            p.AddText("Test 06");

            r = t.AddRow();
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            r = t.AddRow();
            p = r.Cells[1].AddParagraph();
            p.AddFormattedText("For the period:", TextFormat.Bold);
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            p = r.Cells[3].AddParagraph();
            p.AddText("11th March 2019 to 10th March 2020 both days inclusive");

            r = t.AddRow();
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            r = t.AddRow();
            p = r.Cells[1].AddParagraph();
            //p.AddSpace(1);
            p.AddFormattedText("With pilots:", TextFormat.Bold);
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            p = r.Cells[3].AddParagraph();
            p.AddText("Mr. A");
            p.AddLineBreak();
            p.AddLineBreak();
            p.AddText("In addition, whilst giving instructions to the aforementioned pilots, any qualified flying instructor/examiner is automatically included as an approved pilot hereon");

            r = t.AddRow();
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            r = t.AddRow();
            p = r.Cells[1].AddParagraph();
            p.AddFormattedText("Against:", TextFormat.Bold);
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            p = r.Cells[3].AddParagraph();
            p.AddText("The risks of accidental loss of or damage whilst the aircraft is in flight or on the ground anywhere Worldwide, excluding the following countries and regions:");
            p.AddLineBreak();
            p.AddLineBreak();

            p.AddText("(a) Algeria, Burundi, Cabinda, Central African Republic, Congo, Democratic Republic of Congo, Eritrea, Ethiopia, Ivory Coast, Liberia, Mauritania, Nigeria, Somalia, The Republic of Sudan, South Sudan;");
            p.AddLineBreak();
            p.AddLineBreak();
            p.AddText("(b) Colombia, Ecuador, Peru;");
            p.AddLineBreak();
            p.AddLineBreak();
            p.AddText("(c) Afghanistan, Jammu&Kashmir, Myanmar, NorthKorea, Pakistan;");
            p.AddLineBreak();
            p.AddLineBreak();
            p.AddText("(d) Georgia, Nagorno-Karabakh, North Caucasian Federal District, Ukraine;");
            p.AddLineBreak();
            p.AddLineBreak();
            p.AddText("(e) Iran, Iraq, Libya, Syria, Yemen;");
            p.AddLineBreak();
            p.AddLineBreak();
            p.AddText("(f) United States of America and Canada.");
            p.AddLineBreak();


            r.BottomPadding    = row_top_padding;
            t.Rows[0].KeepWith = t.Rows.Count - 1;
            t.SetEdge(0, 1, t.Columns.Count, t.Rows.Count - 1, Edge.Box, MigraDoc.DocumentObjectModel.BorderStyle.Single, table_boarder, table_color);
        }
Exemplo n.º 14
0
        public string GenerateDocument()
        {
            table_color         = Tools.GetTableColorByRetailer("");
            document            = new Document();
            document.Info.Title = "Invoice - ";
            document.DefaultPageSetup.PageHeight   = page_height;
            document.DefaultPageSetup.PageWidth    = page_width;
            document.DefaultPageSetup.TopMargin    = margin;
            document.DefaultPageSetup.LeftMargin   = margin;
            document.DefaultPageSetup.RightMargin  = margin;
            document.DefaultPageSetup.BottomMargin = bottom_margin;

            DefineStyle();

            Section sec = document.AddSection();

            Tools.AddInvoiceFooter(ref sec);

            Image image = new Image();

            image = sec.AddImage(Tools.GetHeaderWithText());

            //image.Width = "190mm";
            //image.Height = "25mm";
            image.Left = ShapePosition.Center;



            Table  t = sec.AddTable();
            Column c = t.AddColumn("120mm");

            c.Format.Alignment = ParagraphAlignment.Left;
            c = t.AddColumn("70mm");
            c.Format.Alignment = ParagraphAlignment.Right;
            Row r = t.AddRow();

            Paragraph p = r.Cells[0].AddParagraph();

            p.Style = "Heading1";
            p.AddText("Invoice");
            p.Format.Alignment    = ParagraphAlignment.Center;
            r.Cells[0].MergeRight = 1;

            r = t.AddRow();
            r = t.AddRow();

            p = r.Cells[0].AddParagraph();

            p.AddText("Sportcruiser Aviation");
            p.AddLineBreak();
            p.AddText("157 Viewmount Park");
            p.AddLineBreak();
            p.AddText("Dunmore Road");
            p.AddLineBreak();
            p.AddText("Waterford");
            p.AddLineBreak();
            p.AddText("Ireland");
            p.AddLineBreak();


            p = r.Cells[1].AddParagraph();
            p.Format.Alignment = ParagraphAlignment.Left;

            p.AddText("Hayward Aviation");
            p.AddLineBreak();
            p.AddText("The St Botolph Building");
            p.AddLineBreak();
            p.AddText("138 Houndsditch");
            p.AddLineBreak();
            p.AddText("London EC3A 7AW");
            p.AddLineBreak();
            p.AddText("Telephone:");
            p.AddTab();

            p.AddText("0207 902 7800");
            p.AddLineBreak();
            p.AddText("Fax:");
            p.AddSpace(2);
            p.AddTab();
            p.AddTab();
            p.AddText("0207 928 8040");
            p.AddLineBreak();

            r = t.AddRow();

            p = r.Cells[0].AddParagraph();
            p.AddText("Date: " + System.DateTime.Today.Date.ToLongDateString());

            r = t.AddRow();
            r = t.AddRow();
            p = r.Cells[0].AddParagraph();

            p.AddFormattedText("Policy Number F186583", TextFormat.NotBold);
            p.AddLineBreak();

            p = r.Cells[1].AddParagraph();
            p.Format.Alignment = ParagraphAlignment.Left;
            p.AddText("Invoice Number F186583001RN");

            AddClientDetails(sec);

            AddMiddleParagraph(sec);

            AddBankDetails(sec);

            AddLastParagraph(sec);
            return(SaveDocument(document));
        }
Exemplo n.º 15
0
        public void AddClientDetails(Section sec)
        {
            Table t = sec.AddTable();

            t.LeftPadding   = "0mm";
            t.RightPadding  = "0mm";
            t.TopPadding    = "0mm";
            t.BottomPadding = "0mm";

            Column c = t.AddColumn("1mm");

            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            c = t.AddColumn("34mm");
            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            c = t.AddColumn("1mm");
            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            c = t.AddColumn("49mm");
            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            c = t.AddColumn("75mm");
            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            c = t.AddColumn("9mm");
            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            c = t.AddColumn("15mm");
            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            c = t.AddColumn("6mm");
            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            Row r = t.AddRow();

            r.Height = "2mm";
            r.Cells[0].AddImage("C:\\images\\transpix.gif").Height = "1mm";
            // r.Cells[1].MergeDown = 2;
            r.Cells[1].Format.Alignment = ParagraphAlignment.Center;
            Image icn = new Image();

            r               = t.AddRow();
            r.Style         = "Heading3";
            r.TopPadding    = row_padding;
            r.BottomPadding = row_padding;

            Paragraph p = r.Cells[1].AddParagraph();

            p.AddSpace(4);
            p.AddText("Policy Details");
            r.Cells[1].Shading.Color = table_color;
            r.Cells[0].Shading.Color = table_color;
            r.Cells[2].MergeRight    = 5;
            r.Cells[1].MergeRight    = 6;

            r = t.AddRow();
            r = t.AddRow();
            p = r.Cells[1].AddParagraph();
            p.AddText("With regards to your policy below we set out details of the following transactions effected on your behalf: -");
            r.Cells[1].MergeRight       = 6;
            r.Cells[1].Format.Alignment = ParagraphAlignment.Center;

            r = t.AddRow();
            // r = t.AddRow();


            r = t.AddRow();
            p = r.Cells[1].AddParagraph();
            p.AddFormattedText("Assured", TextFormat.Bold);
            p.AddLineBreak();

            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            p = r.Cells[3].AddParagraph();
            p.AddText("Sportcruiser Aviation &/or the Irish Light Aviation Society (ILAS) for their respective rights and interests");
            r.Cells[3].MergeRight = 4;

            r = t.AddRow();
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            r = t.AddRow();
            p = r.Cells[1].AddParagraph();
            p.AddFormattedText("Policy Period:", TextFormat.Bold);
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            p = r.Cells[3].AddParagraph();
            p.AddText("11th March 2019 to 10th March 2020 both days inclusive");
            r.Cells[3].MergeRight = 4;

            r = t.AddRow();
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            r = t.AddRow();
            p = r.Cells[1].AddParagraph();
            p.AddFormattedText("Type of Business", TextFormat.Bold);
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            p = r.Cells[3].AddParagraph();
            p.AddText("Munich RE Hull and Liability Insurance");
            r.Cells[3].MergeRight = 4;

            r = t.AddRow();
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            r = t.AddRow();
            p = r.Cells[1].AddParagraph();
            p.AddFormattedText("Regarding", TextFormat.Bold);
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            p = r.Cells[3].AddParagraph();
            p.AddText("Original Premium 2018/19");
            r.Cells[3].MergeRight = 4;


            //r = t.AddRow();
            //r.Cells[1].Borders.Right.Width = 0.5;
            //r.Cells[1].Borders.Right.Color = table_color;

            r = t.AddRow();
            p = r.Cells[4].AddParagraph();
            //p.AddSpace(1);
            p.AddFormattedText("Gross Premium", TextFormat.Bold);

            p = r.Cells[5].AddParagraph();
            p.AddText("GBP");
            p = r.Cells[6].AddParagraph();
            p.AddText("1,947.12");
            r.Cells[6].Format.Alignment = ParagraphAlignment.Right;
            p.AddLineBreak();

            r = t.AddRow();
            p = r.Cells[4].AddParagraph();
            p.AddFormattedText("Plus Customer Service Charge", TextFormat.Bold);

            p = r.Cells[5].AddParagraph();
            p.AddText("GBP");
            p = r.Cells[6].AddParagraph();
            p.AddText("31.50");
            r.Cells[6].Format.Alignment = ParagraphAlignment.Right;
            r = t.AddRow();
            r = t.AddRow();
            p = r.Cells[4].AddParagraph();
            p.AddFormattedText("Premium Due", TextFormat.Bold);
            p = r.Cells[5].AddParagraph();
            p.AddFormattedText("GBP", "Heading4");
            p = r.Cells[6].AddParagraph();
            p.AddFormattedText("1,978.62", "Heading4");
            r.Cells[6].Format.Alignment = ParagraphAlignment.Right;
            p.AddLineBreak();

            r = t.AddRow();
            r = t.AddRow();
            p = r.Cells[1].AddParagraph();
            p.AddFormattedText("THIS PREMIUM IS DUE AND PAYABLE BY RETURN", "Heading4");
            r.Cells[1].Format.Alignment = ParagraphAlignment.Center;
            r.Cells[1].MergeRight       = 6;



            r.BottomPadding    = row_top_padding;
            t.Rows[0].KeepWith = t.Rows.Count - 1;
            t.SetEdge(0, 1, t.Columns.Count, t.Rows.Count - 1, Edge.Box, MigraDoc.DocumentObjectModel.BorderStyle.Single, table_boarder, table_color);
        }
Exemplo n.º 16
0
        public void AddClientDetailsPage2(Section sec)
        {
            Table t = sec.AddTable();

            t.LeftPadding   = "0mm";
            t.RightPadding  = "0mm";
            t.TopPadding    = "0mm";
            t.BottomPadding = "0mm";

            Column c = t.AddColumn("1mm");

            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            c = t.AddColumn("29mm");
            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            c = t.AddColumn("1mm");
            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            c = t.AddColumn("158mm");
            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            c = t.AddColumn("1mm");
            c.Format.Alignment   = ParagraphAlignment.Left;
            c.Format.LeftIndent  = "0mm";
            c.Format.RightIndent = "0mm";

            Row r = t.AddRow();

            r.Height = "2mm";
            r.Cells[0].AddImage("C:\\images\\transpix.gif").Height = "1mm";
            // r.Cells[1].MergeDown = 2;
            r.Cells[1].Format.Alignment = ParagraphAlignment.Center;
            Image icn = new Image();

            r               = t.AddRow();
            r.Style         = "Heading3";
            r.TopPadding    = row_padding;
            r.BottomPadding = row_padding;

            Paragraph p = r.Cells[1].AddParagraph();

            p.AddSpace(4);
            p.AddText("Insurance Details (Cont.)");
            r.Cells[1].Shading.Color = table_color;
            r.Cells[0].Shading.Color = table_color;
            r.Cells[2].MergeRight    = 2;
            r.Cells[1].MergeRight    = 3;

            r        = t.AddRow();
            r.Height = "1mm";
            r.Cells[0].AddImage("C:\\images\\transpix.gif").Height = "1mm";
            r.Cells[2].MergeRight = 2;
            r.Cells[2].AddImage("C:\\images\\transpix.gif").Height = "1mm";
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            r = t.AddRow();
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;
            p = r.Cells[3].AddParagraph();
            p.AddText("In addition coverage is granted:");
            p.AddLineBreak();
            p.AddLineBreak();
            p.AddText("(i) for the overflight of any excluded country or region where the flight is within an internationally recognised air corridor and is performed in accordance with I.C.A.O. recommendations; or");
            p.AddLineBreak();
            p.AddText("ii) in circumstances where an insured Aircraft has landed in an excluded country or region as a direct consequence and exclusively as a result of force majeure.");
            p.AddLineBreak();
            p.AddLineBreak();
            p.AddText("Notwithstanding the above,coverage is excluded for any flight into any country or region where such operation of the Aircraft is in breach of United Nations or European Union sanctions.");

            p.AddLineBreak();
            p.AddText("");
            r = t.AddRow();
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            r = t.AddRow();
            p = r.Cells[1].AddParagraph();
            p.AddFormattedText("Coverage:", TextFormat.Bold);
            r.Cells[1].Borders.Right.Width = 0.5;
            r.Cells[1].Borders.Right.Color = table_color;

            p = r.Cells[3].AddParagraph();
            p.AddText("Includes Legal Liability to Third Parties and Passengers up to the following limit of indemnity in accordance withEC Regulation 785/2004");


            p.AddLineBreak();
            p.AddText("Combined Single Limit (Third PartyLiability and Passenger Liability) any oneaccident increasing to GBP 7,500,000 any one accident in respect of Crown Indemnity and including German Limits and in accordance with The Danish Act DKK 65,000,000 any one accident.");

            p.AddLineBreak();
            p.AddText("War and Allied Risks (Extended Coverage Endorsement AVN 52E) up to a limit of EUR 5000 any one accident and in the annual aggregate (except for passengers to whom the full policy limits shall apply).");


            r.BottomPadding    = row_top_padding;
            t.Rows[0].KeepWith = t.Rows.Count - 1;
            t.SetEdge(0, 1, t.Columns.Count, t.Rows.Count - 1, Edge.Box, MigraDoc.DocumentObjectModel.BorderStyle.Single, table_boarder, table_color);
        }
Exemplo n.º 17
0
        public static void WriteFormattedParagraphFromContent(ref Paragraph p, string content)
        {
            //replace the vars
            string moddedcontent = content;


            moddedcontent = content.Replace("%refference%", "b.bookingReference");

            string[] content_array = moddedcontent.Split('|');

            foreach (string s in content_array)
            {
                if (s != string.Empty)
                {
                    if (s.First().ToString() == "l")
                    {
                        p.AddLineBreak();

                        string s1 = s.Remove(0, 1);

                        if (s1.First().ToString() == "b")
                        {
                            p.AddFormattedText(s1.Remove(0, 1), TextFormat.Bold);
                        }
                        else if (s1.First().ToString() == "t")
                        {
                            p.AddFormattedText(s1.Remove(0, 1), StyleNames.Heading9);
                        }
                        else if (s1.First().ToString() == "r")
                        {
                            p.AddFormattedText(s1.Remove(0, 1), StyleNames.Heading6);
                        }
                        else if (s1.First().ToString() == "c")
                        {
                            p.AddFormattedText(s1.Remove(0, 1), TextFormat.Bold);
                        }

                        else if (s1.First().ToString() == "u")
                        {
                            p.AddFormattedText(s1.Remove(0, 1), StyleNames.Heading7);
                        }
                        else if (s1.First().ToString() == "o" && s1[1].ToString() == " ")
                        {
                            p.AddFormattedText(s1.Remove(0, 1), StyleNames.Heading4);
                        }
                        else if (s1.First().ToString() == "z")
                        {
                            p.AddFormattedText(s1.Remove(0, 1), StyleNames.Heading8);
                        }
                        else if (s1.First().ToString() == "")
                        {
                            // p.AddFormattedText(s1.Remove(0, 1), StyleNames.Heading4);
                        }

                        else if (s1.First().ToString() == "a")
                        {
                            p.AddFormattedText("  " + s1.Remove(0, 1), TextFormat.Bold);
                        }
                        else if (s1.First().ToString() == "h")
                        {
                            string hlinktext = s1.Remove(0, 1).Split('=').Last().Trim();

                            if (hlinktext.Length > 4)
                            {
                                if (hlinktext.Substring(0, 4).ToLower() != "http")
                                {
                                    hlinktext = "http://" + hlinktext;
                                }
                            }

                            Hyperlink hlink = p.AddHyperlink(hlinktext, HyperlinkType.Url);
                            hlink.Font.Color      = new Color(24, 106, 207);
                            hlink.Font.Underline += 1;

                            hlink.AddFormattedText(s1.Remove(0, 1).Split('=').First());
                        }
                        else if (s1.First().ToString() == "e")
                        {
                            string hlinktext = "mailto:" + s1.Remove(0, 1);

                            Hyperlink hlink = p.AddHyperlink(hlinktext, HyperlinkType.Url);
                            hlink.Font.Color      = new Color(24, 106, 207);
                            hlink.Font.Underline += 1;
                            hlink.AddFormattedText(s1.Remove(0, 1).ToUpper(), TextFormat.Bold);
                        }
                        else if (s1.First().ToString() == "s")
                        {
                            p.AddSpace(1);
                        }
                        else
                        {
                            p.AddText(s1);
                        }
                    }

                    else
                    {
                        if (s.First().ToString() == "b")
                        {
                            p.AddFormattedText(s.Remove(0, 1), TextFormat.Bold);
                        }
                        else if (s.First().ToString() == "t")
                        {
                            p.AddFormattedText(s.Remove(0, 1), StyleNames.Heading9);
                        }
                        else if (s.First().ToString() == "c")
                        {
                            p.AddFormattedText(s.Remove(0, 1), TextFormat.Bold);
                        }
                        else if (s.First().ToString() == "r")
                        {
                            p.AddFormattedText(s.Remove(0, 1), StyleNames.Heading6);
                        }
                        else if (s.First().ToString() == "u")
                        {
                            p.AddFormattedText(s.Remove(0, 1), StyleNames.Heading7);
                        }
                        else if (s.First().ToString() == "o" && s[1].ToString() == " ")
                        {
                            p.AddFormattedText(s.Remove(0, 1), StyleNames.Heading4);
                        }

                        else if (s.First().ToString() == "a")
                        {
                            p.AddFormattedText("  " + s.Remove(0, 1), TextFormat.Bold);
                        }
                        else if (s.First().ToString() == "h")
                        {
                            string hlinktext = s.Remove(0, 1).Split('=').Last().Trim();
                            if (hlinktext.Length > 4)
                            {
                                if (hlinktext.Substring(0, 4).ToLower() != "http")
                                {
                                    hlinktext = "http://" + hlinktext;
                                }
                            }

                            Hyperlink hlink = p.AddHyperlink(hlinktext, HyperlinkType.Url);
                            hlink.Font.Color      = new Color(24, 106, 207);
                            hlink.Font.Underline += 1;

                            hlink.AddFormattedText(s.Remove(0, 1).Split('=').First());
                        }
                        else if (s.First().ToString() == "e")
                        {
                            string hlinktext = "mailto:" + s.Remove(0, 1);

                            Hyperlink hlink = p.AddHyperlink(hlinktext, HyperlinkType.Url);
                            hlink.Font.Color      = new Color(24, 106, 207);
                            hlink.Font.Underline += 1;

                            hlink.AddFormattedText(s.Remove(0, 1).ToUpper(), TextFormat.Bold);
                        }
                        else if (s.First().ToString() == "s")
                        {
                            p.AddSpace(1);
                        }
                        else
                        {
                            p.AddText(s);
                        }
                    }
                }
            }
        }