Re: HTML to WORD to PDF

Team

We are facing a production issue

ISSUE:

  • The HTML formated text which appears properly on the browser is being rendered on the PDF generated via aspose with lot of extra space.

SCENARIO:

  • We use attached Template.doc which has predefined placeholder SHAPES and use this to populate the html content at runtime and save this as PDF . Attached is the code snippet used. Along with other required files.
  • The HTML Content in WithIssue.txt starts in NEXT PAGE whereas HTML CONTENT in WithoutIssue.txt comes up properly in next row which is required behavior.
  • Note that WithIssue.txt HTML format has some MS word styling in it and this seems to throw off the text into next page rather than appearing in NEXT ROW.
  • Template used is Template.doc, o/p PDF is WithWhiteSpaceIssue.pdf

VERSION USED:

  • Aspose.PdfAspose.Pdf 7.7.0.0
  • Aspose.WordsAspose.Words 13.2.0.0

Please help!

Team

Can anybody please acknowledge this and reply ?? we are waiting on this thread.

Hi Viswanathan,

Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 13.5.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The issue ID is WORDSNET-8496. Your request has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,
Hi Viswanathan,

Thank you for being patient.

Our development team has completed the analysis of your issue (WORDSNET-8496) and has come to a conclusion that this issue and the undesired behaviour you're observing is actually not a bug in Aspose.Words. We will most likely close this issue as 'Not a Bug'.

The problem occurs because the first paragraph inserted from the HTML fragment has the ‘Heading 2’ style and thereby has the KeepWithNext option enabled. In Microsoft Word, the KeepWithNext option of the first paragraph of the left most Cell of a Table Row is applied to the whole Table Row. Consequently, after the HTML fragment is inserted to a Table Row, the KeepWithNext option is enabled for that Row.

It is expected behaviour of Microsoft Word and to work around this problem please either clear the KeepWithNext option of the first paragraph of the HTML fragment using Aspose.Words or add the ‘page-break-after:avoid’ property to the CSS style of the first

element. I hope, this helps.


Best regards,

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan