Aymkdn / html-to-pdfmake

This module permits to convert HTML to the PDFMake format
https://aymkdn.github.io/html-to-pdfmake/index.html
MIT License
545 stars 88 forks source link

PDFmake does not support the rgba format, so black text displayed as a blue text #221

Closed fahmi-nugroho closed 2 months ago

fahmi-nugroho commented 2 months ago

Provide the HTML code <ul><li><span style=\"background-color:rgb(255,255,255);color:rgba(0,0,0,0.87);\">Sampel AGD curiga darah vena, jika tidak sesuai klinis mohon sampel ulang.</span></li></ul>

Describe the bug Result: [ { "nodeName": "UL", "marginBottom": 5, "marginLeft": 5, "style": [ "html-ul" ], "ul": [ { "text": [ { "text": "Sampel AGD curiga darah vena, jika tidak sesuai klinis mohon sampel ulang.", "nodeName": "SPAN", "background": "#ffffff", "color": "rgba(0,0,0,0.87)", "style": [ "html-span", "html-li", "html-ul" ] } ], "nodeName": "LI", "style": [ "html-li", "html-ul" ] } ] } ] image

Aymkdn commented 2 months ago

This is odd. The rgba is supported... I'll check later.

Aymkdn commented 2 months ago

The code was correctly providing the hexadecimal reference to PDFMake, but it looks like PDFMake doesn't support RGBA.

I made changes: the rgba value will be converted to a rgb color + the opacity of the text. It should work this way.

The v2.5.12 has just been released with the patch.

fahmi-nugroho commented 2 months ago

thank you, for the update