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

Extra spacing between some characters while generating pdf in ubuntu

Open amitchhangani opened this issue 10 years ago • 9 comments

Hi Team, We are facing issue regarding to extra space between some characters while generating pdf in ubuntu. When the pdf is generating through MAC, Every character looks as it is as displayed in html. Please suggest where we are wrong. Thanks.

amitchhangani avatar Jan 22 '16 07:01 amitchhangani

Sounds like a font problem. If the specific font isn't installed on ubuntu, it uses a fallback.

marcbachmann avatar Jan 22 '16 07:01 marcbachmann

screenshot from 2016-01-22 12 46 34 We use Arial Font in body. If I set sans-serif. Some spacing are corrected. But issue still remains

amitchhangani avatar Jan 22 '16 07:01 amitchhangani

screenshot from 2016-01-22 12 52 51 The above i generated through sans-serif.

amitchhangani avatar Jan 22 '16 07:01 amitchhangani

Sorry for that. That's definitely wrong. There's an issue on phantomjs that suggests a solution.

Try to set a zoomfactor or replace the font with another one using font-face. Or some other arial font.

https://github.com/ariya/phantomjs/issues/11413

Sent from my iPhone

On Jan 22, 2016, at 8:17 AM, Amit Chhangani [email protected] wrote:

If i use https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0ahUKEwjTsoq167zKAhVVBY4KHTSjA0YQFgghMAE&url=https%3A%2F%2Fgithub.com%2Fmarcbachmann%2Fnode-html-pdf&usg=AFQjCNH5-FbFxoJZTTjPxKDyJmG1LJ-oiw&sig2=t9x8Spha_NX3T0c6EhKz6g

— Reply to this email directly or view it on GitHub.

marcbachmann avatar Jan 22 '16 07:01 marcbachmann

Ok will look into that. Thanks

amitchhangani avatar Jan 22 '16 08:01 amitchhangani

@amitchhangani , I have the same issue here. Install phantomjs 2.0 (https://github.com/Pyppe/phantomjs2.0-ubuntu14.04x64) and the ttf-mscorefonts-installer solved for me.

carlosacp avatar Jan 22 '16 12:01 carlosacp

In the installation instructions is written:

An extra note on Linux usage, from the PhantomJS download page:

There is no requirement to install Qt, WebKit, or any other libraries. It however still relies on Fontconfig (the package fontconfig or libfontconfig, depending on the distribution).

If you see extra spacing between some characters, so you don't have libfontconfig installed. I think this issue may be closed.

w01fgang avatar Apr 13 '16 17:04 w01fgang

I have the same issue

ubuntu, debian from docker image fixed: apt-get install libfontconfig1

isuvorov avatar Jul 20 '16 17:07 isuvorov

I have the same issue like more spaces and font face changes

ubuntu - AWS EC2 Instance

RaghulXander avatar Aug 28 '18 04:08 RaghulXander