We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

HTML Text with background-color set has unwanted linebreaks

Hi everybody,

I have an issue with the output of HTML text in PDF documents. Once the HTML code includes a background-color style there's a linebreak before and after that part (see sample code).

The intended result is a single line without the linebreaks.

As-Is:

Normal test, and
deleted text
as well as
text with background colors
shouldn't have any linebreaks in it

Intended:

Normal test, and deleted text as well as text with background colors shouldn't have any linebreaks in it

public void StyleAddedLineBreaks()

{

LicenseSetter.LicensePath = ConfigurationManager.AppSettings["Aspose.LicensePath"];

LicenseSetter.SetLicense();

Pdf pdf1 = new Pdf();

Section sec1 = pdf1.Sections.Add();

Text desc;

desc = new Text(“Normal text, and <del style=“background-color:#FFCC99;”>deleted text as well as <ins style=“background-color:#FFFF99;”>text with background colors shouldn’t have any linebreaks in it”);


desc.IsHtmlTagSupported = true;


sec1.Paragraphs.Add(desc);

// Save the resultant PDF document


pdf1.Save(@“C:/temp/StyleAddedLineBreaks.pdf”);


}

Hi Striet,

We are sorry for the inconvenience faced. While testing the scenario with Aspose.Pdf for NET 8.5.0, I've managed to reproduce this issue on my side and logged it in our bug tracking system as PDFNEWNET-35999 for further investigation and resolution. I've also linked your request to this issue and you will be notified via this thread as soon as it is resolved.

Please feel free to contact us for any further assistance.

Best Regards,

Any news, at least a notice that within a year of no status updated on this issue there’s some progress in investigating or even FIXING this issue?

Hi Striet,


Thanks for your patience.<o:p></o:p>

The development team has been busy resolving other priority issues and I am afraid the issue reported earlier is not yet resolved. Nevertheless, I have requested the team to share the ETA regarding its resolution. As soon as we have some definite updates regarding its resolution, we would be more than happy to update you with the status of correction. Please be patient and spare us little more time.

We are really sorry for this inconvenience.

Hi Striet,


Thanks for your patience.

I am afraid due to complexity of this problem, the above stated problem is not yet resolved. Nevertheless, the development team is working hard on resolving this problem and as soon as we have some further updates, we will let you know.

Being able to highlight text is a VERY common use case, and basic core functionality. Please properly prioritize this bug fix.

Hi Striet,


Your concerns have been shared with development team and they will surely consider resolving this problem, as quickly as possible. Please note that development team has further investigated this issue and they do have a plan to get this problem fixed in next release of Aspose.Pdf for .NET 9.5.0 (which is planned to release in August-2014, but still its not a promise).

As soon as we have some further updates, we will let you know.

Hi Striet,


Thanks for your patience.

We are glad to share that the issue reported earlier is resolved and the fix will be included in next release of Aspose.Pdf for .NET 9.5.0. In order to generate correct output, please try using following code snippet.

[C#]

string outFile = “35999.pdf”;<o:p></o:p>

Aspose.Pdf.Document doc = new Aspose.Pdf.Document();

Page page = doc.Pages.Add();

HtmlFragment title = new HtmlFragment("Normal text, and deleted text as well as text with background colors shouldn't have any linebreaks in it");

page.Paragraphs.Add(title);

doc.Save(outFile);

The issues you have found earlier (filed as PDFNEWNET-35999) have been fixed in Aspose.Pdf for .NET 9.5.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.