marcbachmann / node-html-pdf

This repo isn't maintained anymore as phantomjs got dreprecated a long time ago. Please migrate to headless chrome/puppeteer.
MIT License
3.56k stars 545 forks source link

pdf file size 10 times bigger in linux than mac #647

Open muriloneo opened 2 years ago

muriloneo commented 2 years ago

I am creating pdf from html using base64 fonts in html.

on mac 180kb, on linux 1,3mb.

is it a known issue?

pdeveltere commented 2 years ago

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.

muriloneo commented 2 years ago

I think this repo is dead

marcbachmann commented 2 years ago

yes. please migrate to puppeteer if possible

pdeveltere commented 2 years ago

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