PDF drops table cells in conditional Footer

Thank you for your additional information.
Fix of your problem has already been done. But it is not yet included in the release. The release will be closer to the end of March, possibly earlier. Please wait a bit. You will be informed immediately as soon as we released new version of the product with this correction. Sorry for the inconvenience.

Thank you. I appreciate the specifics in your response.

Could I please get an update on this March release?

Hello,
Thank you for your request.
Maybe I confused you with this answer.
So, you reported the original problem “Table with PAGE field in Footer render incorrect after save.” This problem has been solved and will go into the release 9.8.0.0. The second issue that you reported “Fields in the textbox in footer are not updated after the call UpdatePageLayout ().” has not yet been resolved. We will notify you as soon as it is resolved.

No, I think we understand each other. My issue is with “PDF drops tables cells in conditional Footer.” This was the problem first outlined in this post. Please review my original issue for clarification. The issue with textboxes was due to additional bugs I discovered while trying to use a suggested work-around. So, as I clarified in post 287469 and confirmed by AndreyN in post 287505, this has already been fixed. So, my question today is, when will the “March” release be made available to me so that I can go live with my application that is being held up by this bug that is supposedly already corrected?

Hi
Thank you for additional information. The next version of Aspose.Words was postponed due to few important issues we worked and are working on. We plan to release new version in the next couple of weeks. I apologize for inconvenience.
Best regards,

Could I please get an update on release date? This update is holding me up from going live with my application.
thank you

Hello,
Thank you for your inquiry.
The new version will be released within a few days. Please wait a little longer. Sorry for the inconvenience.

Hello, I would like to inform you that the version 9.8.0.0 of our product that has fixing your main (first) problem released. You can download it here. Please test your code again. If you have any difficulties, please contact us.

Well, you guys are getting closer. The full footer is showing up now, but the rest of the document does not for the case that a document has multiple sections. I have included a code example. This example using the same code I included in the beginning of the post, only it is called twiced and merged into one document. The second document does not show up if printing to PDF. Printing to Word is no problem. Call AsposeTest(), it will call AsposeTest2() twice.

public void AsposeTest()
{
    // merge two document together with conditional footers
    // when print PDF, only the first shows up
    Document mergedDoc = null;
    Document oneDoc = null;
    Aspose.Words.Section newSection = null;
    oneDoc = AsposeTest2("this is first document");
    mergedDoc = oneDoc;
    oneDoc = AsposeTest2("this is second document");
    foreach(Aspose.Words.Section s in oneDoc.Sections) //should only be one section
    {
        newSection = (Aspose.Words.Section) mergedDoc.ImportNode(s, true, ImportFormatMode.UseDestinationStyles);
        newSection.PageSetup.RestartPageNumbering = true;
        newSection.PageSetup.PageStartingNumber = 1;
    }
    mergedDoc.Sections.Add(newSection);
    mergedDoc.Save(Response, "filename.pdf", ContentDisposition.Attachment, SaveOptions.CreateSaveOptions(SaveFormat.Pdf));
}

public Document AsposeTest2(string someText)
{
    Document doc = null;
    DocumentBuilder builder = null;
    byte[] byteArray = Encoding.ASCII.GetBytes(someText);
    MemoryStream stream = new MemoryStream(byteArray);
    doc = new Document(stream, new LoadOptions(LoadFormat.Html, string.Empty, string.Empty));
    builder = new DocumentBuilder(doc);
    Aspose.Words.Section currentSection = builder.CurrentSection;
    PageSetup pageSetup = currentSection.PageSetup;
    // conditional footer, last pg or only single page doc versus all other pages
    builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);
    // insert a table with 2 columns to hold footer
    builder.StartTable();
    // Calculate table width as total page width with left and right marins subtracted.
    double tableWidth = pageSetup.PageWidth - pageSetup.LeftMargin - pageSetup.RightMargin;
    ///////////////////////////////////////////////////////////////////// left side footer
    builder.InsertCell();
    builder.CurrentParagraph.ParagraphFormat.Alignment = ParagraphAlignment.Left;
    builder.CellFormat.Width = tableWidth * .50;
    Field field = builder.InsertField("IF \"", null);
    FieldStart fieldStart = field.Start;
    // Move DocumentBuilder cursor to the next run after field start.
    builder.MoveTo(fieldStart.NextSibling.NextSibling);
    builder.InsertField("PAGE", null);
    builder.Write("\" = \"");
    builder.InsertField("NUMPAGES", null);
    builder.Write("\" \""); //start open quote of true condition
    // Insert Conditional Part Of Footer Cell Into Builder (true part)
    builder.InsertHtml("Left Justified Footer for LAST pg");
    builder.Write("\" \""); //close quote for true condition and open quote of false condition
    // Insert Conditional Part Of Footer Cell Into Builder (false part)
    builder.InsertHtml("Left Justified Footer for OTHER pgs");
    builder.Write("\""); //close quote for false condition

    ///////////////////////////////////////////////////////////////////// right side footer
    builder.InsertCell();
    builder.CurrentParagraph.ParagraphFormat.Alignment = ParagraphAlignment.Right;
    builder.CellFormat.Width = tableWidth * .50;
    field = builder.InsertField("IF \"", null);
    fieldStart = field.Start;
    // Move DocumentBuilder cursor to the next run after field start.
    builder.MoveTo(fieldStart.NextSibling.NextSibling);
    builder.InsertField("PAGE", null);
    builder.Write("\" = \"");
    builder.InsertField("NUMPAGES", null);
    builder.Write("\" \""); //start open quote of true condition
    // Insert Conditional Part Of Footer Cell Into Builder (true part)
    builder.InsertHtml("right Justified Footer for LAST pg");
    builder.Write("\" \""); //close quote for true condition and open quote of false condition
    // Insert Conditional Part Of Footer Cell Into Builder (false part)
    builder.InsertHtml("right Justified Footer for OTHER pgs");
    builder.Write("\""); //close quote for false condition
    builder.EndRow();
    builder.EndTable();
    doc.UpdateTableLayout();
    doc.UpdateFields();
    return doc;
}

Hello,
Thank you for your inquiry.
Please try to insert the following code:

mergedDoc.Sections.Add(newSection);
mergedDoc.UpdatePageLayout();
mergedDoc.Save("X:\\filename.pdf", SaveFormat.Pdf);

This should help.

Yes, this worked. I was doing an UpdatePageLayout for each “section,” but not on the final merged document.
I believe this finalizes this ticket.
thank you.

The issues you have found earlier (filed as WORDSNET-4422) have been fixed in this .NET update and in this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.