This is how I am converting HTML to pdf:-
File pdfDest = new File("output");
ConverterProperties converterProperties = new ConverterProperties();
HtmlConverter.convertToPdf(html, new FileOutputStream(pdfDest), converterProperties);
Following is sample HTML to reproduce the issue:-
<html>
<head>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans:wght@400;500;600;700" rel="stylesheet">
<style>
body {
font-family: 'IBM Plex Sans', sans-serif;
color: #444444;
}
.pt-16 {
padding-top: 16px;
}
.pb-16 {
padding-bottom: 16px;
}
.pr-4{
padding-right: 4px;
}
.f-18 {
font-size: 18px;
}
.font-weight-medium {
font-weight: 400;
}
.font-weight-semibold {
font-weight: bold;
}
.font-weight-bold {
font-weight: bold;
}
.data {
display: inline-block;
padding-left: 14px;
padding-top: 5px;
}
</style>
</head>
<body>
<div class="pt-16">
<div class="f-18 font-weight-semibold">4. Time Periods</div>
<div class="pb-16">
<div class="data">
<span class="pr-4">Some data -</span>
<span class="font-weight-medium">Lorem,</span>
<span class="font-weight-medium">Gypsum,</span>
</div>
</div>
</div>
</body>
</html>
Content as seen in browser:-
Content as seen in pdf:-
Clearly, CSS for making Text semibold/ bold is not working, how to fix this? The font seems to be correct, looks issue is only in the CSS