node-html-pdf
node-html-pdf copied to clipboard
pdf file size 10 times bigger in linux than mac
I am creating pdf from html using base64 fonts in html.
on mac 180kb, on linux 1,3mb.
is it a known issue?
I got the same issue, the size of the generated pdf is 100x bigger on linux than on windows:
on windows: 130kb, on linux 15mb.
I think this repo is dead
yes. please migrate to puppeteer if possible
I found the issue. It's connected with this issue of phantomjs https://github.com/ariya/phantomjs/issues/13997, which this library uses under the hood. So you would probably run into the same issue with puppeteer, because I think that library also uses phanthomjs
.
The solution is to not use webfonts in your html. So please check if you have a webfont defined anywhere in a
My solution was to delete:
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese" rel="stylesheet" />
From the html, which contains webfonts.