'Why Font converted to Italic style in generated PDF from HTML?
Using Package: html-pdf https://www.npmjs.com/package/html-pdf
I am trying to apply "Exo 2" font in PDF, It has applied BUT converted PDF showing fonts in italic style https://www.screencast.com/t/wGQ6yEpG It must be normal like we have in HTML content https://www.screencast.com/t/bjgTQR25
Tried to apply many solutions but no luck :(
My HTML content:
<HTML>
<head>
<meta charset="utf-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Exo+2:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<style>
@font-face {
font-family: 'Exo 2';
font-display: swap;
}
.printapp {
font-family: 'Exo 2', 'Din Light', Roboto, 'Helvetica Neue', Arial, sans-serif;
font-size: 12px;
padding: 20px;
background-color: #FFFFFF;
font-style: normal !important;
}
</style>
</head>
<body>
<div class="printapp" style="font-style: normal">SALES ORDER</div>
</body>
</html>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|