3

I am using this wkhtmltopdf 0.12.3 (with patched qt) version of wkhtmltopdf. With Montserrat font-family.

The HTML is like this,

<strong>
    This Agreement for home staging and rental of furniture and accessories 
</strong>
(“Agreement”) is entered this 

Which outputs as,

T his Agre e me nt f or home staging and re ntal of f urniture and acce ssorie s (â​​ Agre e me ntâ​​ )

And,

<u>Services</u>&nbsp; 
Subject to the terms and conditions of this </span>

Which outputs as,

 Se rvice s Subje ct to the te rms and conditions of this

Why these  are comming in between?

I have tried to replace the quotes and spaces like this,

$formData = str_replace('&nbsp;', ' ', $formData);
$formData = str_replace('&quot;', '"', $formData);
$formData = str_replace('“', '"', $formData);
$formData = str_replace('”', '"', $formData);

But didn't helped. Am I doing something wrong? Searched, but cannot find the solution.

Keyur
  • 1,113
  • 1
  • 23
  • 42

1 Answers1

6

Write this after head tag:

<meta charset="UTF-8" />
fizzi
  • 116
  • 4
  • 2
    working for me after adding the meta tag. Tested with `wkhtmltoimage 0.12.5 (with patched qt)` – Nitin Apr 25 '19 at 11:59
  • Set the setting `web.defaultEncoding` to `utf-8` should do the trick. (https://wkhtmltopdf.org/libwkhtmltox/pagesettings.html#pageWeb) – lezhkin11 Oct 21 '19 at 11:43