Headings Messed Up When Convting to pdf

Hi,

I am attaching a document that was created with Aspose.Words 9.0. When I try to convert this document to PDF using Aspose.Words 9.0, the headings which are preceded by page breaks appear incorrectly (i.e., the number for the heading appears on the previous page). I have documents that were created with previous versions of Aspose.Words which I can convert correctly with Aspose.Words 9.0.

P.S. Great work on the “updating the TOC” feature! I have been waiting a
long time for this and you guys nailed it.

Thanks

I don’t know if this helps, but I went back and did some testing with previous dlls and it seems that reports built with Aspose.Words 8.2.1 will convert correctly, but those built with 8.2.2 & 9.0 will not.

Thanks Again

Hi

Thank you for reporting this problem to us. I managed to reproduce it on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.
Best regards.

Thanks for looking into this, but I have found a couple more issues and at least one is related to the subject problem.

The following code is used to insert a TOC field and a pageref field that points to a bookmark at the end of the document (you can test on the doc that I previously attached). If you examine the messagebox output for the TOC and pageref fields, you will notice that the page numbers are incorrect. (Note that the document is set up to update the fields when opened
(via word) so
the issues are corrected when looking at them in Word.)
Also, when opened in Word, the formatting of the TOC seems to be messed up much like the headings in my previous post.
I know that the pageref field worked after the pagination engine was implemented, but does not work on version 9.0.

Dim wrdDoc As New Document(mydir + "test.doc")

Dim builder As DocumentBuilder = New DocumentBuilder(wrdDoc)
builder.MoveTo(wrdDoc.LastSection.Body.LastChild)
builder.InsertParagraph()
builder.InsertBreak(BreakType.PageBreak)
Dim pageNumTOC As Fields.Field = builder.InsertTableOfContents("\O ""1-8""")
pageNumTOC.Update()

builder.MoveToDocumentEnd()
builder.InsertBreak(BreakType.PageBreak)

Dim bookmarkPage As Fields.Field = builder.InsertField("PAGEREF ComputerInput * MERGEFORMAT", "")

wrdDoc.UpdatePageLayout()

MessageBox.Show(pageNumTOC.Result)
MessageBox.Show(bookmarkPage.Result)

wrdDoc.Save(mydir + "test2.doc")

As always, thanks for your help!

Hi

Thank you for additional information. I managed to reproduce the problem on my side. Actually, the reason of the problem is the same because the same rendering engine is used for calculating page numbers and for converting document to PDF.
I will let you know once the issue is resolved.
Best regards.

The issues you have found earlier (filed as 10199) have been fixed in this update.

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