Aspose pdf does not work with CSS? Aspose support- please advise

I am testing aspose pdf because we are considering buying the license to use your software, but it seems like it does not work on img with CSS display:none stylesheet. The image keeps getting displayed in the converted pdf, even though display:none specifies that it should not be.

the html i was testing earlier is much longer, so I tried testing using a simpler html as shown below, but the image is still getting displayed.

<html><br><br><body><br><br><h2>Spectacular Mountain</h2><br><br><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/Intel-logo.svg/293px-Intel-logo.svg.png" style="display:none;"><br><br><p>Notice that the h1 element with display: none; does not take up any space.</p><br><br></body><br><br></html>

this is the C# code i am using to test aspose.pdf

<html><body><h2>Spectacular Mountain</h2><img src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/Intel-logo.svg/293px-Intel-logo.svg.png\" style=\"display:none;\"><p>Notice that the h1 element with display: none; does not take up any space.</p></body></html>";
MemoryStream stream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(responseFromServer));
HtmlLoadOptions options = new HtmlLoadOptions();
options.UseNewConversionEngine = true;
options.PageInfo.Margin.Bottom = 0;
options.PageInfo.Margin.Top = 0;
options.PageInfo.Margin.Right = 0;
options.PageInfo.Margin.Left = 0;
options.PageInfo.Height = Aspose.Pdf.Generator.PageSize.LetterHeight;
options.PageInfo.Width = Aspose.Pdf.Generator.PageSize.LetterWidth;
Aspose.Pdf.Document pdfDocumentAs = new Aspose.Pdf.Document(stream, options);
pdfDocumentAs.Save(@"c:\As_2.pdf");

i have also attached a pdf that’s generated from the above code. it contains the img, but it should not.

Please advise how to make display:none; CSS work (by not displaying image in the converted pdf).



Thanks…

can aspose support please advise?

Hi Brian,


Thanks for your inquiry. I have tested the scenario and noticed that display style sheet property is not working, so logged a ticket PDFNEWNET-39518 in our issue tracking system for further investigation and resolution. We will notify you as soon as it is resolved.

We are sorry for the inconvenience caused.

Best Regards,

The issues you have found earlier (filed as PDFNET-39518) have been fixed in Aspose.PDF for .NET 23.8.