HTML Rendering with TCPDF(PHP)

后端 未结 3 1708
独厮守ぢ
独厮守ぢ 2020-12-18 12:15

I am using TCPDF\'s writeHtml function for a page that renders properly in the browser. In the output PDF, the fonts are too small. I\'ve tried with setFont, but it doesn\'

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-18 12:40

    The best solution that worked for me was to replace 'px' to 'pt' in html code:

    $tidy = str_replace ('px', 'pt', $tidy);
    

    Before on the left side and after replacing on the right: Before on the left side and after on the right

提交回复
热议问题