Free Support Forum - aspose.com

Email Address No Longer Wrapping

In 20.7 long email addresses would wrap in the middle between the display name and address. After 20.8 the email is truncated or causes the page to expand beyond A4 width when using AdjustToWidestPage.

We have been able to mitigate this by adding a <wbr> after the space in the middle of the email address. However in 20.7 the space was enough.

Sample Code
const string html = “<html><body style=‘font-size: 12pt’>To: &quot;verylongemailwrap.test@quitealongdomain.test.example.com&quot; &lt;verylongemailwrap.test@quitealongdomain.test.example.com&gt;</body></html>”;

using (var document = new Aspose.Html.HTMLDocument(html, “.”))
Aspose.Html.Converters.Converter.ConvertHTML(document, new PdfSaveOptions {PageSetup = {AdjustToWidestPage = true}}, “out.pdf”);

@GrantWalker

Could you please share the sample HTML string in a .txt file so that we can test it? We tried copying/pasting the code which you shared and characters like &quot;, &gt; were there.

20_8.pdf (23.7 KB)20_7.pdf (23.7 KB)

Hi, sorry the forum wouldn’t let me upload a text file … I found the pre-formated text option, that I should have used before. Hopefully the code will now be readable. The quote and greater than characters will make up the formatting of the email address when it is rendered.

private static void LongEmailWrapTest()
{
	const string html = "<html><body style='font-size: 12pt'>To: &quot;verylongemailwrap.test@quitealongdomain.test.example.com&quot; &lt;verylongemailwrap.test@quitealongdomain.test.example.com&gt;</body></html>";

	using (var document = new Aspose.Html.HTMLDocument(html, "."))
		Aspose.Html.Converters.Converter.ConvertHTML(document, new PdfSaveOptions {PageSetup = {AdjustToWidestPage = true}}, "out.pdf");
}

@GrantWalker

We were able to notice the similar behavior of the API in our environment while testing the scenario with Aspose.HTML for .NET 20.9. Hence, we have logged an issue as HTMLNET-2845 in our issue tracking system. We will check it in details and keep you informed about its rectification status. Please be patient and spare us some time.

We are sorry for the inconvenience.