예제 #1
0
        /// <summary>
        ///     Creates the dynamic parts of the invoice.
        /// </summary>
        private void FillContent()
        {
            // Fill address in address text frame
            var item      = SelectItem("/invoice/to");
            var paragraph = addressFrame.AddParagraph();

            paragraph.Format.SpaceBefore = 50;
            FormattedText ft = paragraph.AddFormattedText("Bill To.", TextFormat.Bold);

            ft.Font.Size = 13;
            paragraph.AddLineBreak();
            ft           = paragraph.AddFormattedText(customer_details[0], TextFormat.Bold);
            ft.Font.Size = 12;
            ft.Color     = LogoBlue;

            paragraph = addressFrame.AddParagraph();
            paragraph.AddFormattedText("A. ", TextFormat.Bold);
            ft            = paragraph.AddFormattedText(customer_details[1], TextFormat.NotItalic);
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;

            paragraph.AddLineBreak();
            paragraph.AddFormattedText("T. ", TextFormat.Bold);
            ft            = paragraph.AddFormattedText(customer_details[2], TextFormat.NotItalic); paragraph.AddLineBreak();
            ft.Font.Color = Colors.DarkSlateGray;

            paragraph.AddFormattedText("E. ", TextFormat.Bold);
            ft            = paragraph.AddFormattedText(customer_details[3], TextFormat.NotItalic);
            ft.Font.Color = Colors.DarkSlateGray;

            paragraph = receiptDetailsFrame.AddParagraph();
            paragraph.Format.Alignment   = ParagraphAlignment.Left;
            paragraph.Format.SpaceBefore = 50;
            var invoiceNumber = receipt_details[0];
            var date          = receipt_details[1];

            ft           = paragraph.AddFormattedText("Account Due", TextFormat.Bold);
            ft.Font.Size = 13;


            paragraph.AddLineBreak();
            ft           = paragraph.AddFormattedText("€ " + customer_details[4], TextFormat.NotBold);
            ft.Font.Size = 14;
            ft.Color     = LogoBlue;

            paragraph = receiptDetailsFrame.AddParagraph();
            paragraph.AddLineBreak();
            paragraph.AddText("Invoice No.");
            paragraph.AddTab();
            paragraph.AddFormattedText(invoiceNumber, TextFormat.Bold);

            paragraph = receiptDetailsFrame.AddParagraph();
            paragraph.AddText("Account No.");
            paragraph.AddTab();
            paragraph.AddFormattedText(customer_details[5], TextFormat.Bold);
            paragraph.Format.SpaceBefore = 5;

            paragraph = receiptDetailsFrame.AddParagraph();
            paragraph.AddText("Date.");
            paragraph.AddTab();
            paragraph.AddTab();
            paragraph.AddFormattedText(date, TextFormat.Bold);
            paragraph.Format.SpaceBefore = 5;

            // Iterate the invoice items
            for (var i = 0; i < payments.Count; i++)
            {
                // Each item fills two rows
                var row1 = table.AddRow();
                row1.VerticalAlignment = VerticalAlignment.Center;
                row1.TopPadding        = 1.5;
                if (i % 2 == 0)
                {
                    row1.Shading.Color = Colors.AliceBlue;
                }

                row1.Cells[1].Format.Alignment = ParagraphAlignment.Center;
                row1.Cells[2].Format.Alignment = ParagraphAlignment.Center;
                paragraph = row1.Cells[0].AddParagraph();

                paragraph.AddFormattedText(payments[i].paymentMethod.ToString(), TextFormat.Bold);
                row1.Cells[1].AddParagraph(payments[i].paymentNumber);
                row1.Cells[2].AddParagraph(payments[i].paymentDate.ToString("dd/MM/yyyy"));
                row1.Cells[3].AddParagraph(payments[i].amount.ToString());
            }
            //Fill totally 5 rows
            if (payments.Count < 5)
            {
                for (int i = payments.Count; i < 5; i++)
                {
                    var row1 = table.AddRow();
                    row1.Format.LineSpacing = 15;
                    if (i % 2 == 0)
                    {
                        row1.Shading.Color = Colors.AliceBlue;
                    }
                }
            }


            // Add an invisible row as a space line to the table
            var row = table.AddRow();

            row.Height          = 10;
            row.Borders.Visible = false;

            row        = table.AddRow();
            row.Height = 20;

            paragraph = row.Cells[0].AddParagraph();
            ft        = paragraph.AddFormattedText("Total", TextFormat.Bold);

            row.Borders.Visible           = false;
            row.Cells[0].Format.Font.Bold = true;
            row.Cells[0].Format.Alignment = ParagraphAlignment.Right;
            row.Cells[0].MergeRight       = 2;
            row.Cells[3].AddParagraph(receipt_details[3]);
            row.Cells[3].Format.Alignment = ParagraphAlignment.Center;

            paragraph = table.Section.AddParagraph();
            paragraph.Format.RightIndent = 350;
            paragraph.Format.SpaceBefore = 0;
            ft           = paragraph.AddFormattedText("Company Info:", TextFormat.Bold);
            ft.Font.Size = 10;
            paragraph.Format.Borders.Bottom = new Border()
            {
                Width = "1pt", Color = Colors.DarkGray
            };

            paragraph    = table.Section.AddParagraph();
            ft           = paragraph.AddFormattedText("VAT Number: ", TextFormat.Bold);
            ft.Font.Size = 9;
            ft.AddTab(); ft.AddTab();
            ft            = paragraph.AddFormattedText("CY10138984C", TextFormat.NotBold);
            ft.Font.Size  = 9;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;

            paragraph    = table.Section.AddParagraph();
            ft           = paragraph.AddFormattedText("Cheque: ", TextFormat.Bold);
            ft.Font.Size = 9;
            ft.AddTab(); ft.AddTab();
            ft            = paragraph.AddFormattedText("Andreas Panteli Trading LTD", TextFormat.NotBold);
            ft.Font.Size  = 9;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;

            paragraph    = table.Section.AddParagraph();
            ft           = paragraph.AddFormattedText("BANK: ", TextFormat.Bold);
            ft.Font.Size = 9;
            ft.AddTab(); ft.AddTab(); ft.AddTab();
            ft            = paragraph.AddFormattedText("Hellenic Bank ", TextFormat.NotBold);
            ft.Font.Size  = 9;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;

            paragraph    = table.Section.AddParagraph();
            ft           = paragraph.AddFormattedText("IBAN: ", TextFormat.Bold);
            ft.Font.Size = 9;
            ft.AddTab(); ft.AddTab(); ft.AddTab();
            ft            = paragraph.AddFormattedText("CY920050034500034501A6313801", TextFormat.NotBold);
            ft.Font.Size  = 9;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;
            paragraph = table.Section.AddParagraph();

            ft           = paragraph.AddFormattedText("SWIFT: ", TextFormat.Bold);
            ft.Font.Size = 9;
            ft.AddTab(); ft.AddTab();
            ft            = paragraph.AddFormattedText("HEBACY2N ", TextFormat.NotBold);
            ft.Font.Size  = 9;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;


            //Fill the footer frame
            paragraph    = footerFrameLeft.AddParagraph();
            ft           = paragraph.AddFormattedText("Terms & Conditions:", TextFormat.Bold);
            ft.Font.Size = 10;
            paragraph.Format.Borders.Bottom = new Border()
            {
                Width = "1pt", Color = Colors.DarkGray
            };

            paragraph = footerFrameLeft.AddParagraph();
            paragraph.Format.SpaceBefore = 5;
            ft            = paragraph.AddFormattedText(" Καθυστερημένα τιμολόγια πέραν των 30 ημερών θα χρεώνονται με τόκο 5% μηνιαίως.", TextFormat.NotItalic);
            ft.Font.Size  = 8;
            ft.Font.Color = Colors.DarkSlateGray;
            ft            = paragraph.AddFormattedText(" Τα προϊόντα παραμένουν στην ιδιοκτησία της Εταιρείας μέχρι την εξώφληση τους", TextFormat.NotItalic);
            ft.Font.Size  = 8;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.AddLineBreak();
            paragraph.AddLineBreak();
            ft           = paragraph.AddFormattedText("Thank you for your business!", TextFormat.Bold);
            ft.Color     = Colors.DarkGray;
            ft.Font.Size = 9;

            paragraph = footerFrameRight.AddParagraph();
            paragraph.Format.Borders.Bottom = new Border()
            {
                Width = "1pt", Color = Colors.DarkGray
            };
            paragraph = footerFrameRight.AddParagraph();
            paragraph.Format.SpaceBefore = 5;
            ft = paragraph.AddFormattedText("Yiannis Panteli", TextFormat.Bold);
            paragraph.AddLineBreak();
        }
        /// <summary>
        ///     Creates the dynamic parts of the invoice.
        /// </summary>
        private void FillContent()
        {
            // Fill address in address text frame
            var item      = SelectItem("/invoice/to");
            var paragraph = addressFrame.AddParagraph();

            paragraph.Format.SpaceBefore = 50;
            FormattedText ft = paragraph.AddFormattedText("Bill To.", TextFormat.Bold);

            ft.Font.Size = 13;
            paragraph.AddLineBreak();
            ft           = paragraph.AddFormattedText(customer_details[0], TextFormat.Bold);
            ft.Font.Size = 12;
            ft.Color     = LogoBlue;

            paragraph = addressFrame.AddParagraph();
            paragraph.AddFormattedText("A. ", TextFormat.Bold);
            ft            = paragraph.AddFormattedText(customer_details[1], TextFormat.NotItalic);
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;

            paragraph.AddLineBreak();
            paragraph.AddFormattedText("T. ", TextFormat.Bold);
            ft            = paragraph.AddFormattedText(customer_details[2], TextFormat.NotItalic); paragraph.AddLineBreak();
            ft.Font.Color = Colors.DarkSlateGray;

            paragraph.AddFormattedText("E. ", TextFormat.Bold);
            ft            = paragraph.AddFormattedText(customer_details[3], TextFormat.NotItalic);
            ft.Font.Color = Colors.DarkSlateGray;

            paragraph = invoiceDetailsFrame.AddParagraph();
            paragraph.Format.Alignment   = ParagraphAlignment.Left;
            paragraph.Format.SpaceBefore = 50;
            var invoiceNumber = invoice_details[0];
            var date          = invoice_details[1];

            ft           = paragraph.AddFormattedText("Account Due", TextFormat.Bold);
            ft.Font.Size = 13;


            paragraph.AddLineBreak();
            ft           = paragraph.AddFormattedText(customer_details[4], TextFormat.NotBold);
            ft.Font.Size = 14;
            ft.Color     = LogoBlue;

            paragraph = invoiceDetailsFrame.AddParagraph();
            paragraph.AddLineBreak();
            paragraph.AddText("Invoice No.");
            paragraph.AddTab();
            paragraph.AddFormattedText(invoiceNumber, TextFormat.Bold);

            paragraph = invoiceDetailsFrame.AddParagraph();
            paragraph.AddText("Account No.");
            paragraph.AddTab();
            paragraph.AddFormattedText(customer_details[5], TextFormat.Bold);
            paragraph.Format.SpaceBefore = 5;

            paragraph = invoiceDetailsFrame.AddParagraph();
            paragraph.AddText("Date.");
            paragraph.AddTab();
            paragraph.AddTab();
            paragraph.AddFormattedText(date, TextFormat.Bold);
            paragraph.Format.SpaceBefore = 5;

            // Create the header of the table

            var row = table.AddRow();

            row.HeadingFormat = true;

            row.Cells[3].AddParagraph().AddImage("../../Images/invoiceDesign2.png").Width = "15.9cm";

            // Iterate the invoice items
            for (var i = 0; i < products.Count; i++)
            {
                double quantity = products[i].Quantity;
                var    price    = GetValueAsDouble(item, "price");
                var    discount = GetValueAsDouble(item, "discount");

                // Each item fills two rows
                var row1 = table.AddRow();
                row1.Format.LineSpacing = 15;
                if (i % 2 == 0)
                {
                    row1.Shading.Color = Colors.AliceBlue;
                }
                row1.VerticalAlignment          = VerticalAlignment.Center;
                row1.TopPadding                 = 1.5;
                row1.Cells[0].VerticalAlignment = VerticalAlignment.Center;
                row1.Cells[0].Format.Alignment  = ParagraphAlignment.Left;
                row1.Cells[1].Format.Alignment  = ParagraphAlignment.Center;
                row1.Cells[2].Format.Alignment  = ParagraphAlignment.Center;
                row1.Cells[3].Format.Alignment  = ParagraphAlignment.Center;

                row1.Cells[2].AddParagraph(products[i].Quantity.ToString());
                paragraph = row1.Cells[0].AddParagraph();
                paragraph.AddFormattedText(products[i].ProductName, TextFormat.Bold);
                row1.Cells[1].AddParagraph(products[i].SellPrice.ToString("c"));
                row1.Cells[3].AddParagraph(products[i].Total.ToString("c"));
                row1.Cells[3].VerticalAlignment = VerticalAlignment.Center;
                row1.Cells[1].VerticalAlignment = VerticalAlignment.Center;
            }
            //Fill totally 5 rows
            if (products.Count < 5)
            {
                for (int i = products.Count; i < 5; i++)
                {
                    var row1 = table.AddRow();
                    row1.Format.LineSpacing = 15;
                    if (i % 2 == 0)
                    {
                        row1.Shading.Color = Colors.AliceBlue;
                    }
                }
            }


            // Add an invisible row as a space line to the table
            row                 = table.AddRow();
            row.Height          = 10;
            row.Borders.Visible = false;

            // Add the total price row
            row        = table.AddRow();
            row.Height = 20;

            row.Borders.Visible = false;
            row.Cells[0].AddParagraph("Sub Total");
            row.Cells[0].Format.Font.Bold = true;
            row.Cells[0].Format.Alignment = ParagraphAlignment.Right;
            row.Cells[0].MergeRight       = 2;
            row.Cells[3].AddParagraph(invoice_details[3]);
            row.Cells[3].Format.Alignment = ParagraphAlignment.Center;

            // Add the VAT row
            row        = table.AddRow();
            row.Height = 20;

            row.Borders.Visible = false;
            row.Cells[0].AddParagraph("VAT (19%)");
            row.Cells[0].Format.Font.Bold = true;
            row.Cells[0].Format.Alignment = ParagraphAlignment.Right;
            row.Cells[0].MergeRight       = 2;
            row.Cells[3].AddParagraph(invoice_details[4]);
            row.Cells[3].Format.Alignment = ParagraphAlignment.Center;


            // Add the total due row
            row        = table.AddRow();
            row.Height = 20;

            paragraph                     = row.Cells[0].AddParagraph("Grand Total");
            row.Borders.Visible           = false;
            row.Cells[0].Format.Font.Bold = true;
            row.Cells[0].Format.Alignment = ParagraphAlignment.Right;
            row.Cells[0].MergeRight       = 2;
            row.Cells[3].AddParagraph(invoice_details[5]);
            row.Cells[3].Format.Alignment = ParagraphAlignment.Center;

            paragraph = table.Section.AddParagraph();
            paragraph.Format.RightIndent = 350;
            paragraph.Format.SpaceBefore = -60;
            ft           = paragraph.AddFormattedText("Company Info:", TextFormat.Bold);
            ft.Font.Size = 10;
            paragraph.Format.Borders.Bottom = new Border()
            {
                Width = "1pt", Color = Colors.DarkGray
            };

            paragraph    = table.Section.AddParagraph();
            ft           = paragraph.AddFormattedText("VAT Number: ", TextFormat.Bold);
            ft.Font.Size = 9;
            ft.AddTab(); ft.AddTab();
            ft            = paragraph.AddFormattedText("CY10138984C", TextFormat.NotBold);
            ft.Font.Size  = 9;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;

            paragraph    = table.Section.AddParagraph();
            ft           = paragraph.AddFormattedText("Cheque: ", TextFormat.Bold);
            ft.Font.Size = 9;
            ft.AddTab(); ft.AddTab();
            ft            = paragraph.AddFormattedText("Andreas Panteli Trading LTD", TextFormat.NotBold);
            ft.Font.Size  = 9;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;

            paragraph    = table.Section.AddParagraph();
            ft           = paragraph.AddFormattedText("BANK: ", TextFormat.Bold);
            ft.Font.Size = 9;
            ft.AddTab(); ft.AddTab(); ft.AddTab();
            ft            = paragraph.AddFormattedText("Hellenic Bank ", TextFormat.NotBold);
            ft.Font.Size  = 9;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;

            paragraph    = table.Section.AddParagraph();
            ft           = paragraph.AddFormattedText("IBAN: ", TextFormat.Bold);
            ft.Font.Size = 9;
            ft.AddTab(); ft.AddTab(); ft.AddTab();
            ft            = paragraph.AddFormattedText("CY920050034500034501A6313801", TextFormat.NotBold);
            ft.Font.Size  = 9;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;
            paragraph = table.Section.AddParagraph();

            ft           = paragraph.AddFormattedText("SWIFT: ", TextFormat.Bold);
            ft.Font.Size = 9;
            ft.AddTab(); ft.AddTab();
            ft            = paragraph.AddFormattedText("HEBACY2N ", TextFormat.NotBold);
            ft.Font.Size  = 9;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;


            //Fill the footer frame
            paragraph    = footerFrameLeft.AddParagraph();
            ft           = paragraph.AddFormattedText("Terms & Conditions:", TextFormat.Bold);
            ft.Font.Size = 10;
            paragraph.Format.Borders.Bottom = new Border()
            {
                Width = "1pt", Color = Colors.DarkGray
            };

            paragraph = footerFrameLeft.AddParagraph();
            paragraph.Format.SpaceBefore = 5;
            ft            = paragraph.AddFormattedText(" Καθυστερημένα τιμολόγια πέραν των 30 ημερών θα χρεώνονται με τόκο 5% μηνιαίως.", TextFormat.NotItalic);
            ft.Font.Size  = 8;
            ft.Font.Color = Colors.DarkSlateGray;
            ft            = paragraph.AddFormattedText(" Τα προϊόντα παραμένουν στην ιδιοκτησία της Εταιρείας μέχρι την εξώφληση τους", TextFormat.NotItalic);
            ft.Font.Size  = 8;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.AddLineBreak();
            paragraph.AddLineBreak();
            ft           = paragraph.AddFormattedText("Thank you for your business!", TextFormat.Bold);
            ft.Color     = Colors.DarkGray;
            ft.Font.Size = 9;

            //add number of pages
            paragraph.AddLineBreak();
            ft           = paragraph.AddFormattedText("Page ", TextFormat.NotItalic);
            ft.Font.Size = 8;
            paragraph.AddPageField();
            ft           = paragraph.AddFormattedText(" of ", TextFormat.NotItalic);
            ft.Font.Size = 8;
            paragraph.AddNumPagesField();

            paragraph = footerFrameRight.AddParagraph();
            paragraph.Format.Borders.Bottom = new Border()
            {
                Width = "1pt", Color = Colors.DarkGray
            };
            paragraph = footerFrameRight.AddParagraph();
            paragraph.Format.SpaceBefore = 5;
            ft = paragraph.AddFormattedText("Yiannis Panteli", TextFormat.Bold);
            paragraph.AddLineBreak();

            paragraph = footerFrameRight.AddParagraph();
            paragraph.AddLineBreak();
            paragraph.AddLineBreak();
            paragraph.AddLineBreak();

            paragraph.Format.Borders.Bottom = new Border()
            {
                Width = "1pt", Color = Colors.DarkGray
            };
            paragraph = footerFrameRight.AddParagraph();

            paragraph.Format.SpaceBefore = 5;
            paragraph.AddText("For ");
            ft = paragraph.AddFormattedText(customer_details[0], TextFormat.Bold);
            paragraph.AddLineBreak();
            ft.Font.Size = 10;
        }
        /// <summary>
        ///     Creates the dynamic parts of the invoice.
        /// </summary>
        private void FillContent()
        {
            // Fill address in address text frame
            var item      = SelectItem("/invoice/to");
            var paragraph = addressFrame.AddParagraph();

            paragraph.Format.SpaceBefore = 55;
            FormattedText ft = paragraph.AddFormattedText("Customer Info.", TextFormat.Bold);

            ft.Font.Size = 13;
            paragraph.AddLineBreak();
            ft           = paragraph.AddFormattedText(customer_details[0], TextFormat.Bold);
            ft.Font.Size = 12;
            ft.Color     = LogoBlue;

            paragraph = addressFrame.AddParagraph();
            paragraph.AddFormattedText("A. ", TextFormat.Bold);
            ft            = paragraph.AddFormattedText(customer_details[1], TextFormat.NotItalic);
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;

            paragraph.AddLineBreak();
            paragraph.AddFormattedText("T. ", TextFormat.Bold);
            ft            = paragraph.AddFormattedText(customer_details[2], TextFormat.NotItalic); paragraph.AddLineBreak();
            ft.Font.Color = Colors.DarkSlateGray;

            paragraph.AddFormattedText("E. ", TextFormat.Bold);
            ft            = paragraph.AddFormattedText(customer_details[3], TextFormat.NotItalic);
            ft.Font.Color = Colors.DarkSlateGray;

            paragraph = quoteDetailsFrame.AddParagraph();
            paragraph.Format.Alignment   = ParagraphAlignment.Left;
            paragraph.Format.SpaceBefore = 20;
            var invoiceNumber = quote_details[0];
            var date          = quote_details[1];

            paragraph = quoteDetailsFrame.AddParagraph();
            paragraph.AddLineBreak();
            paragraph.AddText("Quote No.");
            paragraph.AddTab();
            paragraph.AddFormattedText(invoiceNumber, TextFormat.Bold);

            paragraph = quoteDetailsFrame.AddParagraph();
            paragraph.AddText("Account No.");
            paragraph.AddTab();
            paragraph.AddFormattedText(customer_details[5], TextFormat.Bold);
            paragraph.Format.SpaceBefore = 2;

            paragraph = quoteDetailsFrame.AddParagraph();
            paragraph.AddText("Date.");
            paragraph.AddTab();
            paragraph.AddTab();
            paragraph.AddFormattedText(date, TextFormat.Bold);
            paragraph.Format.SpaceBefore = 2;

            paragraph = quoteDetailsFrame.AddParagraph();
            paragraph.AddText("Valid Until.");
            paragraph.AddTab();
            paragraph.AddFormattedText("31/12/" + DateTime.Now.Year.ToString(), TextFormat.Bold);
            paragraph.Format.SpaceBefore = 2;


            //Salesperson information
            var salesperson = "Yiannis Panteli";
            var telephone   = "+357 96361198";
            var email       = "*****@*****.**";

            if (quote_details[2] == "V.A")
            {
                salesperson = "Vasos Anayiotos";
                telephone   = "+357 99676298";
                email       = "*****@*****.**";
            }

            paragraph = quoteDetailsFrame.AddParagraph();
            paragraph.Format.SpaceBefore = 5;
            ft           = paragraph.AddFormattedText("Salesperson Info.", TextFormat.Bold);
            ft.Font.Size = 12;
            paragraph.AddLineBreak();
            ft           = paragraph.AddFormattedText(salesperson, TextFormat.Bold);
            ft.Font.Size = 11;
            ft.Color     = LogoBlue;

            paragraph = quoteDetailsFrame.AddParagraph();
            paragraph.AddFormattedText("T. ", TextFormat.Bold);
            ft            = paragraph.AddFormattedText(telephone, TextFormat.NotItalic); paragraph.AddLineBreak();
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 2;

            paragraph.AddFormattedText("E. ", TextFormat.Bold);
            ft            = paragraph.AddFormattedText(email, TextFormat.NotItalic);
            ft.Font.Color = Colors.DarkSlateGray;

            var row = table.AddRow();

            row.HeadingFormat = true;

            row.Cells[3].AddParagraph().AddImage("../../Images/quoteDesign-02.png").Width = "15.9cm";

            // Iterate the invoice items
            for (var i = 0; i < products.Count; i++)
            {
                double quantity = products[i].Quantity;
                var    price    = GetValueAsDouble(item, "price");
                var    discount = GetValueAsDouble(item, "discount");

                // Each item fills two rows
                var row1 = table.AddRow();
                row1.VerticalAlignment = VerticalAlignment.Center;

                row1.Format.LineSpacing = 15;
                if (i % 2 == 0)
                {
                    row1.Shading.Color = Colors.AliceBlue;
                }
                row1.Cells[1].Format.Alignment = ParagraphAlignment.Left;
                row1.Cells[2].Format.Alignment = ParagraphAlignment.Left;
                row1.Cells[3].Format.Alignment = ParagraphAlignment.Center;

                row1.Cells[0].AddParagraph(products[i].idProduct.ToString());
                paragraph = row1.Cells[1].AddParagraph();
                paragraph.AddFormattedText(products[i].ProductName, TextFormat.Bold);
                row1.Cells[2].AddParagraph(products[i].ProductDescription);
                row1.Cells[3].AddParagraph(products[i].OfferPrice.ToString("c"));
            }
            //Fill totally 5 rows
            if (products.Count < 5)
            {
                for (int i = products.Count; i < 5; i++)
                {
                    var row1 = table.AddRow();
                    row1.Format.LineSpacing = 15;
                    if (i % 2 == 0)
                    {
                        row1.Shading.Color = Colors.AliceBlue;
                    }
                }
            }

            paragraph = table.Section.AddParagraph();
            paragraph.Format.RightIndent = 350;
            paragraph.Format.SpaceBefore = 20;
            ft           = paragraph.AddFormattedText("Company Info:", TextFormat.Bold);
            ft.Font.Size = 10;
            paragraph.Format.Borders.Bottom = new Border()
            {
                Width = "1pt", Color = Colors.DarkGray
            };

            paragraph    = table.Section.AddParagraph();
            ft           = paragraph.AddFormattedText("VAT Number: ", TextFormat.Bold);
            ft.Font.Size = 9;
            ft.AddTab(); ft.AddTab();
            ft            = paragraph.AddFormattedText("CY10138984C", TextFormat.NotBold);
            ft.Font.Size  = 9;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;

            paragraph    = table.Section.AddParagraph();
            ft           = paragraph.AddFormattedText("Cheque: ", TextFormat.Bold);
            ft.Font.Size = 9;
            ft.AddTab(); ft.AddTab();
            ft            = paragraph.AddFormattedText("Andreas Panteli Trading LTD", TextFormat.NotBold);
            ft.Font.Size  = 9;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;

            paragraph    = table.Section.AddParagraph();
            ft           = paragraph.AddFormattedText("BANK: ", TextFormat.Bold);
            ft.Font.Size = 9;
            ft.AddTab(); ft.AddTab(); ft.AddTab();
            ft            = paragraph.AddFormattedText("Hellenic Bank ", TextFormat.NotBold);
            ft.Font.Size  = 9;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;

            paragraph    = table.Section.AddParagraph();
            ft           = paragraph.AddFormattedText("IBAN: ", TextFormat.Bold);
            ft.Font.Size = 9;
            ft.AddTab(); ft.AddTab(); ft.AddTab();
            ft            = paragraph.AddFormattedText("CY920050034500034501A6313801", TextFormat.NotBold);
            ft.Font.Size  = 9;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;
            paragraph = table.Section.AddParagraph();

            ft           = paragraph.AddFormattedText("SWIFT: ", TextFormat.Bold);
            ft.Font.Size = 9;
            ft.AddTab(); ft.AddTab();
            ft            = paragraph.AddFormattedText("HEBACY2N ", TextFormat.NotBold);
            ft.Font.Size  = 9;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.Format.SpaceBefore = 5;


            //Fill the footer frame
            paragraph    = footerFrameLeft.AddParagraph();
            ft           = paragraph.AddFormattedText("Terms & Conditions:", TextFormat.Bold);
            ft.Font.Size = 10;
            paragraph.Format.Borders.Bottom = new Border()
            {
                Width = "1pt", Color = Colors.DarkGray
            };

            paragraph = footerFrameLeft.AddParagraph();
            paragraph.Format.SpaceBefore = 5;
            ft            = paragraph.AddFormattedText(" The above prices do not include VAT.", TextFormat.NotItalic);
            ft.Font.Size  = 8;
            ft.Font.Color = Colors.DarkSlateGray;
            paragraph.AddLineBreak();
            paragraph.AddLineBreak();
            ft           = paragraph.AddFormattedText("Thank you for your business!", TextFormat.Bold);
            ft.Font.Size = 8;
            ft.Color     = Colors.DarkGray;

            //add number of pages
            paragraph.AddLineBreak();
            paragraph.AddLineBreak();
            ft           = paragraph.AddFormattedText("Page ", TextFormat.NotItalic);
            ft.Font.Size = 8;
            paragraph.AddPageField();
            ft           = paragraph.AddFormattedText(" of ", TextFormat.NotItalic);
            ft.Font.Size = 8;
            paragraph.AddNumPagesField();

            paragraph = footerFrameRight.AddParagraph();
            paragraph.Format.Borders.Bottom = new Border()
            {
                Width = "1pt", Color = Colors.DarkGray
            };
            paragraph = footerFrameRight.AddParagraph();
            paragraph.Format.SpaceBefore = 5;
            ft = paragraph.AddFormattedText("Yiannis Panteli", TextFormat.Bold);
            paragraph.AddLineBreak();

            paragraph = footerFrameRight.AddParagraph();
            paragraph.Format.SpaceBefore = 5;
            ft = paragraph.AddFormattedText("If you have any questions concerning this quotation, please contact: ", TextFormat.NotItalic);
            paragraph.AddLineBreak();
            ft.Font.Size  = 8;
            ft.Font.Color = Colors.DarkSlateGray;
            ft            = paragraph.AddFormattedText("Email: [email protected]", TextFormat.NotItalic);
            ft.Font.Size  = 8;
            ft.Font.Color = Colors.DarkSlateGray;

            paragraph.AddLineBreak();
            ft = paragraph.AddFormattedText("Phone: +357 96361198", TextFormat.NotItalic);
            paragraph.AddLineBreak();

            ft.Font.Size  = 8;
            ft.Font.Color = Colors.DarkSlateGray;
        }