//document header private void AddDocHeader() { Table netSalaryTable = new Table(5); netSalaryTable.WidthPercentage = 100; netSalaryTable.Padding = 1; netSalaryTable.Spacing = 1; netSalaryTable.Border = Table.NO_BORDER; Cell employernameCell = new Cell(new Phrase(_ViewModel.employername.ToUpper(), new Font(Font.TIMES_ROMAN, 12, Font.BOLD | Font.UNDERLINE, Color.BLACK))); employernameCell.HorizontalAlignment = Cell.ALIGN_CENTER; employernameCell.Colspan = 5; employernameCell.Border = Cell.NO_BORDER; netSalaryTable.AddCell(employernameCell); Cell employeraddressCell = new Cell(new Phrase(_ViewModel.employeraddress, new Font(Font.TIMES_ROMAN, 10, Font.BOLD | Font.UNDERLINE, Color.BLACK))); employeraddressCell.HorizontalAlignment = Cell.ALIGN_CENTER; employeraddressCell.Colspan = 5; employeraddressCell.Border = Cell.NO_BORDER; netSalaryTable.AddCell(employeraddressCell); Cell bCell = new Cell(new Phrase("NET SALARIES", hFont1)); bCell.HorizontalAlignment = Cell.ALIGN_CENTER; bCell.Colspan = 5; bCell.Border = Cell.NO_BORDER; netSalaryTable.AddCell(bCell); Cell reportNameCell = new Cell(new Phrase(_ViewModel.ReportName, hFont2)); reportNameCell.HorizontalAlignment = Cell.ALIGN_CENTER; reportNameCell.Colspan = 5; reportNameCell.Border = Cell.NO_BORDER; netSalaryTable.AddCell(reportNameCell); Cell PrintedonCell = new Cell(new Phrase("Printed on: " + _ViewModel.PrintedOn.ToString("dd-dddd-MMMM-yyyy"), hFont2)); PrintedonCell.HorizontalAlignment = Cell.ALIGN_LEFT; PrintedonCell.Colspan = 4; PrintedonCell.Border = Cell.NO_BORDER; netSalaryTable.AddCell(PrintedonCell); //create the logo PDFGen pdfgen = new PDFGen(); Image img0 = pdfgen.DoGetImageFile(_ViewModel.CompanyLogo); img0.Alignment = Image.ALIGN_MIDDLE; Cell logoCell = new Cell(img0); logoCell.HorizontalAlignment = Cell.ALIGN_LEFT; logoCell.Border = Cell.NO_BORDER; logoCell.Add(new Phrase(_ViewModel.CompanySlogan, new Font(Font.HELVETICA, 8, Font.ITALIC, Color.BLACK))); netSalaryTable.AddCell(logoCell); document.Add(netSalaryTable); }
//document header private void AddDocHeader() { try { Table bankTransferTable = new Table(5); bankTransferTable.WidthPercentage = 100; bankTransferTable.Padding = 1; bankTransferTable.Spacing = 1; bankTransferTable.Border = Table.NO_BORDER; Cell employernameCell = new Cell(new Phrase(_ViewModel.employername.ToUpper(), new Font(Font.TIMES_ROMAN, 12, Font.BOLD | Font.UNDERLINE, Color.BLACK))); employernameCell.HorizontalAlignment = Cell.ALIGN_CENTER; employernameCell.Colspan = 5; employernameCell.Border = Cell.NO_BORDER; bankTransferTable.AddCell(employernameCell); Cell employeraddressCell = new Cell(new Phrase(_ViewModel.employeraddress, new Font(Font.TIMES_ROMAN, 10, Font.BOLD | Font.UNDERLINE, Color.BLACK))); employeraddressCell.HorizontalAlignment = Cell.ALIGN_CENTER; employeraddressCell.Colspan = 5; employeraddressCell.Border = Cell.NO_BORDER; bankTransferTable.AddCell(employeraddressCell); Cell reportNameCell = new Cell(new Phrase(_ViewModel.ReportName, hFont1)); reportNameCell.HorizontalAlignment = Cell.ALIGN_CENTER; reportNameCell.Colspan = 5; reportNameCell.Border = Cell.NO_BORDER; bankTransferTable.AddCell(reportNameCell); Cell reportdateCell = new Cell(new Phrase("Print Date: " + _ViewModel.PrintedOn.ToString("dd-dddd-MMMM-yyyy"), tHfont1)); reportdateCell.HorizontalAlignment = Cell.ALIGN_LEFT; reportdateCell.Colspan = 4; reportdateCell.Border = Cell.NO_BORDER; bankTransferTable.AddCell(reportdateCell); //create the logo PDFGen pdfgen = new PDFGen(); Image img0 = pdfgen.DoGetImageFile(_ViewModel.CompanyLogo); img0.Alignment = Image.ALIGN_MIDDLE; Cell logoCell = new Cell(img0); logoCell.HorizontalAlignment = Cell.ALIGN_LEFT; logoCell.Border = Cell.NO_BORDER; logoCell.Add(new Phrase(_ViewModel.CompanySlogan, new Font(Font.HELVETICA, 8, Font.ITALIC, Color.BLACK))); bankTransferTable.AddCell(logoCell); } catch (Exception ex) { Utils.ShowError(ex); } }
private void AddDocHeader() { PDFGen pdfgen = new PDFGen(); Image img0 = pdfgen.DoGetImageFile(_resourcePath + "kra2.jpg"); img0.Alignment = Image.ALIGN_CENTER; Table empInfoTable = new Table(3, 4); empInfoTable.WidthPercentage = 100; empInfoTable.Border = Table.NO_BORDER; Phrase header1 = new Phrase(_ViewModel.ReportName, hFont2); Cell c2 = new Cell(header1); c2.Border = Cell.NO_BORDER; c2.HorizontalAlignment = Cell.ALIGN_CENTER; // c1.Colspan = 3; empInfoTable.AddCell(c2, new System.Drawing.Point(1, 1)); // Phrase header1 = new Phrase(_ViewModel.ReportName, hFont2); Cell c1 = new Cell(img0);// header1); c1.Border = Cell.NO_BORDER; c1.HorizontalAlignment = Cell.ALIGN_CENTER; // c1.Colspan = 3; empInfoTable.AddCell(c1, new System.Drawing.Point(0, 1)); Chunk employerName = new Chunk("Employers Name ..." + _ViewModel.EmployerName.ToUpper().Trim() + "..", bFont1); Cell empCell = new Cell(employerName); empCell.Border = Cell.NO_BORDER; empInfoTable.AddCell(empCell, new System.Drawing.Point(2, 0)); Chunk employerPIN = new Chunk("Employer's PIN ..." + _ViewModel.EmployerPin.Trim() + "..", bFont1); Cell empPINCell = new Cell(employerPIN); empPINCell.Border = Cell.NO_BORDER; empInfoTable.AddCell(empPINCell, new System.Drawing.Point(2, 2)); Chunk employeeName = new Chunk("Employee’s Main Name………" + _ViewModel.EmployeeMainName.Trim() + "……....", bFont1); Cell empNameCell = new Cell(employeeName); empNameCell.Border = Cell.NO_BORDER; empInfoTable.AddCell(empNameCell, new System.Drawing.Point(3, 0)); Chunk employeeOName = new Chunk("Employee’s Other Names……" + _ViewModel.EmployeeOtherNames.Trim() + "……....", bFont1); Cell empeONameCell = new Cell(employeeOName); empeONameCell.Border = Cell.NO_BORDER; empInfoTable.AddCell(empeONameCell, new System.Drawing.Point(4, 0)); Chunk employeePIN = new Chunk("Employee’s PIN…………………" + _ViewModel.EmployeePin.Trim() + "………....", bFont1); Cell empePINCell = new Cell(employeePIN); empePINCell.Border = Cell.NO_BORDER; empInfoTable.AddCell(empePINCell, new System.Drawing.Point(4, 2)); document.Add(empInfoTable); document.Add(new Phrase("", new Font(Font.TIMES_ROMAN, 2, Font.NORMAL))); }
//document header private void AddDocHeader() { Table bankTransferTable = new Table(5); bankTransferTable.WidthPercentage = 100; bankTransferTable.Padding = 1; bankTransferTable.Spacing = 1; bankTransferTable.Border = Table.NO_BORDER; Cell employernameCell = new Cell(new Phrase(_ViewModel.employername.ToUpper(), new Font(Font.TIMES_ROMAN, 12, Font.BOLD | Font.UNDERLINE, Color.BLACK))); employernameCell.HorizontalAlignment = Cell.ALIGN_CENTER; employernameCell.Colspan = 5; employernameCell.Border = Cell.NO_BORDER; bankTransferTable.AddCell(employernameCell); Cell employeraddressCell = new Cell(new Phrase(_ViewModel.employeraddress, new Font(Font.TIMES_ROMAN, 10, Font.BOLD | Font.UNDERLINE, Color.BLACK))); employeraddressCell.HorizontalAlignment = Cell.ALIGN_CENTER; employeraddressCell.Colspan = 5; employeraddressCell.Border = Cell.NO_BORDER; bankTransferTable.AddCell(employeraddressCell); Cell reportNameCell = new Cell(new Phrase(_ViewModel.ReportName, hFont1)); reportNameCell.HorizontalAlignment = Cell.ALIGN_CENTER; reportNameCell.Colspan = 5; reportNameCell.Border = Cell.NO_BORDER; bankTransferTable.AddCell(reportNameCell); StringBuilder sb = new StringBuilder(); sb.AppendLine("The Manager"); sb.AppendLine(_ViewModel.Bank); sb.AppendLine(_ViewModel.BankBranch); Cell salutationCell = new Cell(new Chunk(sb.ToString(), hfont2)); salutationCell.Border = Cell.NO_BORDER; salutationCell.HorizontalAlignment = Cell.ALIGN_LEFT; salutationCell.Colspan = 5; bankTransferTable.AddCell(salutationCell); Cell reportdateCell = new Cell(new Phrase("Print Date: " + _ViewModel.PrintedOn.ToString("dd-dddd-MMMM-yyyy"), tHfont1)); reportdateCell.HorizontalAlignment = Cell.ALIGN_LEFT; reportdateCell.Colspan = 4; reportdateCell.Border = Cell.NO_BORDER; bankTransferTable.AddCell(reportdateCell); //create the logo PDFGen pdfgen = new PDFGen(); Image img0 = pdfgen.DoGetImageFile(_ViewModel.CompanyLogo); img0.Alignment = Image.ALIGN_MIDDLE; Cell logoCell = new Cell(img0); logoCell.HorizontalAlignment = Cell.ALIGN_LEFT; logoCell.Border = Cell.NO_BORDER; logoCell.Add(new Phrase(_ViewModel.CompanySlogan, new Font(Font.HELVETICA, 8, Font.ITALIC, Color.BLACK))); bankTransferTable.AddCell(logoCell); document.Add(bankTransferTable); document.Add(new Phrase("\n\nDear Sir/Madam", new Font(Font.TIMES_ROMAN, 8, Font.NORMAL))); document.Add(new Phrase("\nRE: CREDIT TRANSFER - SALARY PROCESSING", new Font(Font.TIMES_ROMAN, 8, Font.BOLD | Font.UNDERLINE))); document.Add(new Phrase("\n\nBelow is a list of Names, Banks, Branches, Account and Amounts to be credited in their respective Accounts", new Font(Font.TIMES_ROMAN, 8, Font.NORMAL))); }
private void BuildPDF() { try { // step 1: creation of a document-object document = new Document(PageSize.A4.Rotate()); // step 2: we create a writer that listens to the document PdfWriter.GetInstance(document, new FileStream(sFilePDF, FileMode.Create)); document.Open(); PDFGen pdfgen = new PDFGen(); Image img0 = pdfgen.DoGetImageFile(_resourcePath + "kra2.jpg"); img0.Alignment = Image.ALIGN_CENTER; Table empInfoTable = new Table(3, 3); empInfoTable.WidthPercentage = 100; empInfoTable.Border = Table.NO_BORDER; Phrase header1 = new Phrase(_ViewModel.ReportName, hFont2); Cell c2 = new Cell(header1); c2.Border = Cell.NO_BORDER; c2.HorizontalAlignment = Cell.ALIGN_CENTER; empInfoTable.AddCell(c2, new System.Drawing.Point(1, 1)); Cell c1 = new Cell(img0);// header1); c1.Border = Cell.NO_BORDER; c1.HorizontalAlignment = Cell.ALIGN_CENTER; empInfoTable.AddCell(c1, new System.Drawing.Point(0, 1)); empInfoTable.Border = Table.NO_BORDER; Chunk employerName = new Chunk("Employers Name ..." + _ViewModel.EmployerName.ToUpper().Trim() + "..", bFont1); Cell empCell = new Cell(employerName); empCell.Border = Cell.NO_BORDER; empInfoTable.AddCell(empCell, new System.Drawing.Point(2, 0)); Chunk employerPIN = new Chunk("Employer's PIN ..." + _ViewModel.EmployerPin.Trim() + "..", bFont1); Cell empPINCell = new Cell(employerPIN); empPINCell.Border = Cell.NO_BORDER; empInfoTable.AddCell(empPINCell, new System.Drawing.Point(2, 2)); Chunk employeeName = new Chunk("Employee’s Main Name………" + _ViewModel.EmployeeMainName.Trim() + "……....", bFont1); Cell empNameCell = new Cell(employeeName); empNameCell.Border = Cell.NO_BORDER; empInfoTable.AddCell(empNameCell, new System.Drawing.Point(3, 0)); Chunk employeeOName = new Chunk("Employee’s Other Names……" + _ViewModel.EmployeeOtherNames.Trim() + "……....", bFont1); Cell empeONameCell = new Cell(employeeOName); empeONameCell.Border = Cell.NO_BORDER; empInfoTable.AddCell(empeONameCell, new System.Drawing.Point(4, 0)); Chunk employeePIN = new Chunk("Employee’s PIN…………………" + _ViewModel.EmployeePin.Trim() + "………....", bFont1); Cell empePINCell = new Cell(employeePIN); empePINCell.Border = Cell.NO_BORDER; empInfoTable.AddCell(empePINCell, new System.Drawing.Point(4, 2)); document.Add(empInfoTable); document.Add(new Phrase("", new Font(Font.TIMES_ROMAN, 2, Font.NORMAL))); Table taxTable = new Table(15, 16); taxTable.Padding = 1; taxTable.Spacing = 1; taxTable.WidthPercentage = 100; //Add table headers AddTableHeaders(taxTable); for (int i = 1; i <= 12; i++) { var monthRecs = (from mr in _ViewModel.P9AHospEmpList where mr.MonthInt == i select mr).SingleOrDefault(); AddTableRow(i, taxTable, monthRecs); } //Add totals AddTotals(taxTable); document.Add(taxTable); AddFooter(); document.Close(); } catch (DocumentException de) { this.Message = de.Message; } catch (IOException ioe) { this.Message = ioe.Message; } catch (Exception ex) { Log.WriteToErrorLogFile(ex); } }
//document header private void AddDocHeader() { PDFGen pdfgen = new PDFGen(); Image img0 = pdfgen.DoGetImageFile(_resourcePath + "kra2.jpg"); img0.Alignment = Image.ALIGN_CENTER; Table p11taxInfoTable = new Table(4); p11taxInfoTable.WidthPercentage = 100; p11taxInfoTable.Border = Table.NO_BORDER; Cell header = new Cell(img0); header.Border = Cell.NO_BORDER; header.HorizontalAlignment = Cell.ALIGN_CENTER; p11taxInfoTable.AddCell(header, new System.Drawing.Point(0, 1)); Cell p11reportname = new Cell(new Phrase("Income Tax Department", hFont1)); p11reportname.HorizontalAlignment = Cell.ALIGN_CENTER; p11reportname.Border = Cell.NO_BORDER; p11taxInfoTable.AddCell(p11reportname, new System.Drawing.Point(2, 1)); Cell emppayeecreditslip = new Cell(new Phrase("P.A.Y.E CREDIT SLIP", hFont2)); emppayeecreditslip.HorizontalAlignment = Cell.ALIGN_CENTER; emppayeecreditslip.Border = Cell.NO_BORDER; p11taxInfoTable.AddCell(emppayeecreditslip, new System.Drawing.Point(3, 1)); Cell emporiginal = new Cell(new Phrase("ORIGINAL", tcFont2)); emporiginal.HorizontalAlignment = Cell.ALIGN_RIGHT; emporiginal.Border = Cell.NO_BORDER; p11taxInfoTable.AddCell(emporiginal, new System.Drawing.Point(3, 3)); Cell empserialno = new Cell(new Phrase("SERIAL NO......................", tcFont2)); empserialno.HorizontalAlignment = Cell.ALIGN_LEFT; empserialno.Border = Cell.NO_BORDER; p11taxInfoTable.AddCell(empserialno, new System.Drawing.Point(4, 2)); Cell emppayrollmonth = new Cell(new Phrase("Pay Roll Month..." + _ViewModel.payrollmonth, tcFont2)); emppayrollmonth.HorizontalAlignment = Cell.ALIGN_LEFT; emppayrollmonth.Border = Cell.NO_BORDER; p11taxInfoTable.AddCell(emppayrollmonth, new System.Drawing.Point(5, 2)); Cell empemployerpin = new Cell(new Phrase("Employer's P.I.N..." + " " + _ViewModel.employerpin, tcFont2)); empemployerpin.HorizontalAlignment = Cell.ALIGN_LEFT; empemployerpin.Border = Cell.NO_BORDER; p11taxInfoTable.AddCell(empemployerpin, new System.Drawing.Point(6, 2)); document.Add(p11taxInfoTable); p11taxInfoTable = new Table(1); p11taxInfoTable.WidthPercentage = 100; p11taxInfoTable.Border = Table.NO_BORDER; Cell empemployername = new Cell(new Phrase("Employer's Name..." + _ViewModel.employername.ToUpper() + "\nTo...........................................Bank. \nPlease pay the Central Bank of Kenya , for the credit of the Paymaster - General, PAYE Account No. 05-010-0056 \n " + "Amount..........." + _ViewModel.totalpayee.ToString("C2") + "\n(In words) Kenya Shillings...........................................................................................................................................\n", tcFont2)); empemployername.HorizontalAlignment = Cell.ALIGN_LEFT; empemployername.Border = Cell.NO_BORDER; p11taxInfoTable.AddCell(empemployername, new System.Drawing.Point(0, 0)); Cell emppayment = new Cell(new Phrase("NATURE OF PAYMENT.", new Font(Font.TIMES_ROMAN, 8, Font.BOLD | Font.UNDERLINE))); emppayment.HorizontalAlignment = Cell.ALIGN_LEFT; emppayment.Border = Cell.NO_BORDER; p11taxInfoTable.AddCell(emppayment, new System.Drawing.Point(1, 0)); Cell payment = new Cell(new Phrase("1...................................................................\n2.....................................................................", tcFont2)); payment.HorizontalAlignment = Cell.ALIGN_LEFT; payment.Border = Cell.NO_BORDER; p11taxInfoTable.AddCell(payment, new System.Drawing.Point(2, 0)); Cell pay = new Cell(new Phrase(".", bFont2)); pay.HorizontalAlignment = Cell.ALIGN_LEFT; pay.Border = Cell.NO_BORDER; p11taxInfoTable.AddCell(pay, new System.Drawing.Point(3, 0)); document.Add(p11taxInfoTable); }
private void BuildP10PDF() { try { document = new Document(PageSize.A4.Rotate()); PdfWriter.GetInstance(document, new FileStream(sFilePDF, FileMode.Create)); document.Open(); PDFGen pdfgen = new PDFGen(); Image img0 = pdfgen.DoGetImageFile(_resourcePath + "kra2.jpg"); img0.Alignment = Image.ALIGN_CENTER; Table empInfoTable = new Table(3, 3); empInfoTable.WidthPercentage = 100; empInfoTable.Border = Table.NO_BORDER; Phrase header1 = new Phrase(_ViewModel.ReportName, hFont2); Cell c2 = new Cell(header1); c2.Border = Cell.NO_BORDER; c2.HorizontalAlignment = Cell.ALIGN_CENTER; // c1.Colspan = 3; empInfoTable.AddCell(c2, new System.Drawing.Point(1, 1)); // Phrase header1 = new Phrase(p9A.ReportName, hFont2); Cell c1 = new Cell(img0);// header1); c1.Border = Cell.NO_BORDER; c1.HorizontalAlignment = Cell.ALIGN_CENTER; // c1.Colspan = 3; empInfoTable.AddCell(c1, new System.Drawing.Point(0, 1)); Chunk name = new Chunk("_ViewModel", bFont1); Cell empPINCell1 = new Cell(name); empPINCell1.Border = Cell.NO_BORDER; empInfoTable.AddCell(empPINCell1, new System.Drawing.Point(1, 0)); Chunk employerPIN = new Chunk("Employer's PIN ..." + _ViewModel.EmployerPin.Trim() + "...", bFont1); Cell empPINCell = new Cell(employerPIN); empPINCell.Border = Cell.NO_BORDER; empInfoTable.AddCell(empPINCell, new System.Drawing.Point(1, 2)); document.Add(empInfoTable); Table empInfoTable2 = new Table(1, 4); empInfoTable2.WidthPercentage = 100; empInfoTable2.Border = Table.NO_BORDER; Phrase header2 = new Phrase("To Senior Assistant Commissioner...........\n", bFont1); Cell c3 = new Cell(header2); c3.Border = Cell.NO_BORDER; c3.HorizontalAlignment = Cell.ALIGN_LEFT; c3.VerticalAlignment = Cell.ALIGN_CENTER; empInfoTable2.AddCell(c3, new System.Drawing.Point(1, 0)); Chunk info = new Chunk("We/I forward herewith...................Tax Deduction Cards(P9A/P9B)showing the Total tax deducted\n (as listed on P10A) amounting to Kshs........" + _ViewModel.TotalPAYETax.ToString("#,##0") + "\n This Total tax has been paid as follows:- ", bFont1); Cell info1 = new Cell(info); info1.Border = Cell.NO_BORDER; info1.HorizontalAlignment = Cell.ALIGN_LEFT; empInfoTable2.AddCell(info1, new System.Drawing.Point(2, 0)); Chunk info2 = new Chunk(".", bFont1); Cell info3 = new Cell(info2); info3.Border = Cell.NO_BORDER; info3.HorizontalAlignment = Cell.ALIGN_LEFT; empInfoTable2.AddCell(info3, new System.Drawing.Point(3, 0)); document.Add(empInfoTable2); Table taxTable = new Table(5, 14); taxTable.Padding = 1; taxTable.Spacing = 1; taxTable.WidthPercentage = 100; //Add table headers AddTableHeaders(taxTable); for (int i = 1; i <= 12; i++) { var monthRecs = (from mr in _ViewModel.P10tax where mr.MonthInt == i select mr).SingleOrDefault(); AddTableRow(i, taxTable, monthRecs); } //Add totals AddTotals(taxTable); document.Add(taxTable); AddFooter(); document.Close(); } catch (DocumentException de) { this.Message = de.Message; } catch (IOException ioe) { this.Message = ioe.Message; } catch (Exception ex) { Log.WriteToErrorLogFile(ex); } }
private void BuildPDF() { try { // step 1: creation of a document-object document = new Document(PageSize.A4); // step 2: we create a writer that listens to the document PdfWriter.GetInstance(document, new FileStream(sFilePDF, FileMode.Create)); document.Open(); PDFGen pdfgen = new PDFGen(); Image img0 = pdfgen.DoGetImageFile(_resourcePath + "kra2.jpg"); img0.Alignment = Image.ALIGN_LEFT; Table empInfoTable = new Table(1); empInfoTable.WidthPercentage = 100; empInfoTable.Border = Table.NO_BORDER; Phrase header1 = new Phrase(_ViewModel.ReportName, hFont2); Cell c2 = new Cell(header1); c2.Border = Cell.NO_BORDER; c2.HorizontalAlignment = Cell.ALIGN_CENTER; // c1.Colspan = 3; empInfoTable.AddCell(c2, new System.Drawing.Point(1, 0)); Cell c1 = new Cell(img0);// header1); c1.Border = Cell.NO_BORDER; c1.HorizontalAlignment = Cell.ALIGN_CENTER; // c1.Colspan = 3; empInfoTable.AddCell(c1, new System.Drawing.Point(0, 0)); Chunk name = new Chunk("P.A.Y.E SUPPORTING LIST FOR END OF YEAR CERTIFICATE: YEAR.." + _ViewModel.Year.ToString() + "..", bFont2); Cell emp2Cell = new Cell(name); emp2Cell.Border = Cell.NO_BORDER; empInfoTable.AddCell(emp2Cell, new System.Drawing.Point(2, 0)); Chunk formname = new Chunk("P10A", bFont1); Cell emp1Cell = new Cell(formname); emp1Cell.Border = Cell.NO_BORDER; emp1Cell.HorizontalAlignment = Cell.ALIGN_LEFT; empInfoTable.AddCell(emp1Cell, new System.Drawing.Point(3, 0)); Chunk employerName = new Chunk("Employer's Name ..." + _ViewModel.EmployerName.ToUpper().Trim() + ".......... Employer's PIN ..." + _ViewModel.EmployerPin.Trim() + "..", bFont1); Cell empCell = new Cell(employerName); empCell.Border = Cell.NO_BORDER; empInfoTable.AddCell(empCell, new System.Drawing.Point(4, 0)); document.Add(empInfoTable); document.Add(new Phrase("", new Font(Font.TIMES_ROMAN, 2, Font.NORMAL))); Table taxTable = new Table(4); taxTable.Padding = 1; taxTable.Spacing = 1; taxTable.WidthPercentage = 100; //Add table headers AddTableHeaders(taxTable); //Add table details foreach (var tr in _ViewModel.P10AList) { AddTableRow(taxTable, tr); } //Add totals AddTotals(taxTable); document.Add(taxTable); AddFooter(); document.Close(); } catch (DocumentException de) { this.Message = de.Message; } catch (IOException ioe) { this.Message = ioe.Message; } catch (Exception ex) { Log.WriteToErrorLogFile(ex); } }