title: itextpdf generates blurry pictures
body: <p>I am using itextpdf html2pdf tool to implement freemarker template to generate pdf</p>
  <p>Refer to the official documentation link：
  <a href="https://kb.itextpdf.com/home/it7kb/ebooks/itext-7-converting-html-to-pdf-with-pdfhtml/chapter-7-frequently-asked-questions-about-pdfhtml/can-pdfhtml-render-base64-images-to-pdf" rel="nofollow noreferrer">https://kb.itextpdf.com/home/it7kb/ebooks/itext-7-converting-html-to-pdf-with-pdfhtml/chapter-7-frequently-asked-questions-about-pdfhtml/can-pdfhtml-render-base64-images-to-pdf</a></p>
  <p>The front end uses echarts to convert the image to base64.</p>
  <p>The picture can be displayed clearly on the browser, but after the pdf is generated, the picture becomes blurry.</p>
  <p>Refer to html and pdf image comparison：</p>
  <p><a href="https://i.stack.imgur.com/qkxKE.png" rel="nofollow noreferrer">html</a>  <a href="https://i.stack.imgur.com/UNMPc.png" rel="nofollow noreferrer">pdf</a></p>
  <pre><code>public static void main(String[] args) throws Exception{
      File file = FileUtil.newFile(&quot;D:/test.html&quot;);
      BufferedOutputStream outputStream = FileUtil.getOutputStream(&quot;D:/test.pdf&quot;);
      BufferedInputStream inputStream = FileUtil.getInputStream(file);
      ConverterProperties converterProperties=new ConverterProperties();
      FontProvider fontProvider=new DefaultFontProvider();
      FontProgram fontProgram = FontProgramFactory.createFont(Constant.CONFIG_PATH+File.separator+&quot;simsun.ttc,1&quot;);
      fontProvider.addFont(fontProgram);
      MediaDeviceDescription mediaDeviceDescription = new MediaDeviceDescription(MediaType.SCREEN);
      mediaDeviceDescription.setResolution(2000f);
      converterProperties.setFontProvider(fontProvider);
      converterProperties.setMediaDeviceDescription(mediaDeviceDescription);
      PdfDocument pdfDoc = new PdfDocument(new PdfWriter(outputStream));
      pdfDoc.setDefaultPageSize(new PageSize(1000,1700));
      HtmlConverter.convertToPdf(inputStream,pdfDoc,converterProperties);
  }
  </code></pre>