alvarcarto / url-to-pdf-api

Web page PDF/PNG rendering done right. Self-hosted service for rendering receipts, invoices, or any content.
MIT License
7.01k stars 774 forks source link

Do not support Chinese Website #16

Closed universe-st closed 6 years ago

universe-st commented 6 years ago

Such as Baidu, a search engine like google in China. It cannot parse Chinese characters on this web page. https://url-to-pdf-api.herokuapp.com/api/render?url=http://www.baidu.com

riston commented 6 years ago

This is something related to question here: https://github.com/alvarcarto/url-to-pdf-api/issues/5

mjvcallibrity commented 6 years ago

Just for clarification, this is what I see when I go to the link you provided, @kuangthree:

screen shot 2017-10-09 at 6 42 18 am

When I navigate to baidu.com myself, it looks the same as what is rendered by the link you provided. Is there something else you are expecting to see?

universe-st commented 6 years ago

@mjvcallibrity Yes, that's what I want. Now when I go to the link, I see what I expecting to see. It seems that the problem has fixed. Thanks for your reminding!

xjkwq1qq commented 6 years ago

I have the same problem when build it in my system,when I test with baidu http://10.173.44.53:10002/api/render?url=http://www.baidu.com

like this Image of baidu_err

is there something need setting?

universe-st commented 6 years ago

@xjkwq1qq Maybe the response under this issue can help you. https://github.com/alvarcarto/url-to-pdf-api/issues/5

xjkwq1qq commented 6 years ago

@kuangthree i install on docker,not on Heroku

mjvcallibrity commented 6 years ago

@xjkwq1qq If I had to take a guess, whatever image you used in your docker install doesn't support chinese character text display. What OS image did you use in your docker installation? Do you know if that image supports chinese character text display?

kimmobrunfeldt commented 6 years ago

I fixed this in Heroku by adding this buildpack: https://github.com/debitoor/heroku-buildpack-converter-fonts. It installs a few more fonts to the Heroku environment. That would need to be done in the Docker setup separately.

xjkwq1qq commented 6 years ago

@mjvcallibrity @kimmobrunfeldt thanks,I installation in ubuntu,it does not support chinese character text display default.I need to add a chinese font, it will be work

kimmobrunfeldt commented 6 years ago

The fix for font related issues are to install fonts into the system where this API is running. By default we're installing some fonts to Heroku.