This project has moved and is read-only. For the latest updates, please go here.
1
Vote

Duplicate footer-n A second instance of footer dispalyed while editing docx generated from a web app.

description

While editing a docx file ..I see a second instance of the footer. Tried hard but cannot get rid of it. Please find the code below. I don't see anything wrong with the code but the duplicating footer is driving crazy.


Code:
Footer footer_main = document.Footers.odd;
            //document.Footers.even = document.Footers.odd;
            Novacode.Table first_footer_Table = footer_main.InsertTable(1, 2);
            first_footer_Table.Design = TableDesign.TableNormal;
            first_footer_Table.AutoFit = AutoFit.ColumnWidth;

            first_footer_Table.Rows[0].Cells[0].Width = 240;
            Paragraph footTable_leftCell = first_footer_Table.Rows[0].Cells[0].InsertParagraph();
            footTable_leftCell.Alignment = Alignment.left;
            footTable_leftCell.FontSize(5);
            footTable_leftCell.AppendLine("...");
            footTable_leftCell.AppendLine("abc").Font(new FontFamily("Times New Roman")).FontSize(9);
            footTable_leftCell.AppendLine("\n" + "xyz. All Rights Reserved.").Font(new FontFamily("Gotham Light")).FontSize(7);

            first_footer_Table.Rows[0].Cells[1].Width = 400;
            Paragraph footTable_RightCell = first_footer_Table.Rows[0].Cells[1].InsertParagraph();
            footTable_RightCell.Alignment = Alignment.right;
            footTable_RightCell.FontSize(4);
            footTable_RightCell.Append("\nPage ").Font(new FontFamily("Times New Roman")).FontSize(10).AppendPageNumber(PageNumberFormat.normal);
            footTable_RightCell.Append(" of ").Font(new FontFamily("Times New Roman")).FontSize(10).AppendPageCount(PageNumberFormat.normal);
            footTable_RightCell.Append("\n" + model.FooterDate + " ").Font(new FontFamily("Times New Roman")).FontSize(10).Append(model.AppraisalRef).Font(new FontFamily("Times New Roman")).FontSize(10);
            if (model.AppraisalType == "Insurance")
            {
                footTable_RightCell.AppendLine("Retail Replacement Value").FontSize(10);
            }
            if (model.AppraisalType == "Charitable Donations")
            {
                footTable_RightCell.AppendLine("Fair Market Value for Charitable Donation").FontSize(10);
            }
            if (model.AppraisalType == "Damage and Loss")
            {
                footTable_RightCell.AppendLine("Retail Replacement Value for Damage & Loss").FontSize(10);
            }
            if (model.AppraisalType == "Divorce")
            {
                footTable_RightCell.AppendLine("Fair Market Value for Equitable Distribution & Divorce").FontSize(10);
            }
            if (model.AppraisalType == "Estate/Probate")
            {
                footTable_RightCell.AppendLine("Fair Market Value for Estate & Probate").FontSize(10);
            }
            if (model.AppraisalType == "Fair Market Value")
            {
                footTable_RightCell.AppendLine("Fair Market Value for Estate Planning").FontSize(10);
            }

file attachments

comments