title: How can I change the html encoding to render the pdf correctly with openhtmltopdf?
body: <p>I am using the code: <a href="https://github.com/danfickle/openhtmltopdf" rel="nofollow noreferrer">https://github.com/danfickle/openhtmltopdf</a>
  Did everything according to the example from here (created a maven project, created a main-class): <a href="https://www.netjstech.com/2021/02/convert-html-to-pdf-java-Openhtmltopdf-PDFBox.html" rel="nofollow noreferrer">https://www.netjstech.com/2021/02/convert-html-to-pdf-java-Openhtmltopdf-PDFBox.html</a>
  I am feeding html as input, but I have two problems:</p>
  <ol>
  <li>Russian letters and some icons (for example, №) are not displayed, instead it writes ###. I tried to connect fonts. Downloaded from here: <a href="https://fonts.google.com/specimen/Open+Sans#standard-styles" rel="nofollow noreferrer">https://fonts.google.com/specimen/Open+Sans#standard-styles</a>
  In the main class I wrote:
  <code>builder.useFont (new File (&quot; OpenSans-ExtraBold.ttf &quot;),&quot; OpenSans-ExtraBold &quot;);</code>
  But still the pdf displays ###.</li>
  <li>The pdf file is cropped (50% of the information on the right is not displayed). You need to change the scale or make it landscape.
  I tried to edit the html itself so that the program would process it correctly, but it didn't work either.</li>
  </ol>
  <pre><code>&lt;html lang =&quot; ru &quot;&gt;
  &lt;head&gt;
  &lt;META http-equiv = &quot;Content-Type&quot; content = &quot;text / html; charset = UTF-8&quot; /&gt; 
  </code></pre>
  <p>As I understand it, it's not about the fonts and orientation, but the html encoding. What should I change in it?</p>
  <p>html: <a href="https://file.io/x8GCNFpgML7S" rel="nofollow noreferrer">https://file.io/x8GCNFpgML7S</a>
  pdf: <a href="https://file.io/VUJ3s1jZBux8" rel="nofollow noreferrer">https://file.io/VUJ3s1jZBux8</a></p>