jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

jspdf.html() function cannot parse CSS code

Open jay08111 opened this issue 2 years ago • 1 comments

I'm trying to convert html to pdf by useing jspdf's html() function. First off , I'm running into a problem that my inline CSS Code isn't parsed by html() function.

  <!DOCTYPE html>
                    <html>
                         <head>
                         <meta charset="UTF-8">
                             <style>
                             ${style}
                             </style>
                         </head>
                         <body>
                            <h1 style='color:red;'>hey</h1>
                            <h1 style='font-family : Malgun Gothic'>안녕</h1>
                         </body>
                     </html>

Second, as you can see above there is Korean in my html file . Jspdf cannot parse Korean and I've tried to use setFont , It doesn't work either including Inline CSS fon-family . I hope somebody can teach me what's wrong with my code .

I have read and understood the contribution guidelines. I'm using Vue2 + jsPDF

jay08111 avatar Sep 20 '22 08:09 jay08111

Can I work on this issue?

Bibhavshah avatar Oct 01 '22 13:10 Bibhavshah

This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

github-actions[bot] avatar Dec 31 '22 01:12 github-actions[bot]

Hello, any updates on this one? Is there a preferred way to set the style of the document other than inline?

VersusF avatar Feb 03 '23 14:02 VersusF

@VersusF updated nothing cause I build pdf on server. you can work with this issue now. I wanted to style my pdf file with css but It didn't work properly.

jay08111 avatar Feb 04 '23 08:02 jay08111

Will this be fixed?

GatoVuelta avatar Oct 10 '23 19:10 GatoVuelta