node-html-pdf icon indicating copy to clipboard operation
node-html-pdf copied to clipboard

Why Font converted to `Italic` style in generated PDF from HTML?

Open denishcrest opened this issue 2 years ago • 2 comments

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>

denishcrest avatar May 06 '22 08:05 denishcrest

In the generated pdf, all text has been converted to italic. I don't know why? I have the same problem in both versions: 3.0.0 and 3.0.1

aroshanzamir avatar May 07 '22 06:05 aroshanzamir

I have the same problem with version 2.2.0

flvrm92 avatar Jul 04 '22 19:07 flvrm92