node-html-pdf icon indicating copy to clipboard operation
node-html-pdf copied to clipboard

pdf file size 10 times bigger in linux than mac

Open muriloneo opened this issue 3 years ago • 4 comments

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

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

is it a known issue?

muriloneo avatar Sep 06 '21 14:09 muriloneo

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.

pdeveltere avatar Mar 04 '22 01:03 pdeveltere

I think this repo is dead

muriloneo avatar Mar 09 '22 16:03 muriloneo

yes. please migrate to puppeteer if possible

marcbachmann avatar Mar 09 '22 17:03 marcbachmann

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&amp;subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese" rel="stylesheet" /> From the html, which contains webfonts.

pdeveltere avatar Mar 09 '22 17:03 pdeveltere