Hi Aspose Team,
i use Aspose.Pdf 9.8.0.0 and try to import a HTML document into a PDF document. All is fine except css rgba colors, i.e. used in “background-color: rgba( 255, 0, 0, 0.2 );”. The alpha transparency part in HSLA doesn’t work also, i.e.: “background-color: hsla(120,100%,50%,0.2);”
rgba( 255, 0, 0, 0 )
results in white background (full transparency).
rgba( 255, 0, 0, 0.1 )
results in full red background (no transparency).
As written in your support document:
http://www.aspose.com/docs/display/pdfnet/Supported+CSS+features
(CSS Color Units)
rgba should be supported.
Please see the following code for an example. The resulting file is attached.
Public Sub GeneratePdf()
Dim HtmlContent As String
HtmlContent = “” &
“” &
“<style type=”“text/css”“>” &
“div.Red {” &
" background-color: rgba(255, 0, 0, 0.1);" &
" border: 1px solid #d4d4d4;" &
" width: 200px;" &
" height: 100px;" &
“}” &
“” &
“” &
“” &
“<div class=”“Red”“>Hello World” &
“” &
“”
Dim Stream As New MemoryStream( Encoding.UTF8.GetBytes( HtmlContent ) )
Dim HtmlToPdfLoadOptions As New HtmlLoadOptions()
Dim HtmlToPdfDocument As New Aspose.Pdf.Document( Stream, HtmlToPdfLoadOptions )
HtmlToPdfDocument.Save( “X:\Folder\HtmlToPdfTest.pdf” )
HtmlToPdfDocument.Dispose()
Stream.Close()
Stream.Dispose()
End Sub
Hi Stefan,
Thanks
for using our API’s.<o:p></o:p>
I have tested the scenario and I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-37814. We will investigate this issue in details and will keep you updated on the status of a correction.
We apologize for your inconvenience.
Is there any updates on this issue?
Hi Stefan,
Thanks for your patience.
The team has been busy fixing other priority issues reported earlier and the issue reported in this thread is not yet resolved. However I have intimated the team to start investigating this problem and as soon as we have some further updates, we will let you know.
The issues you have found earlier (filed as PDFNEWNET-37814) have been fixed in Aspose.Pdf for .NET 10.3.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.