1

Scenario:

I am trying to take the screenshot of the new web application created by the user using a background process. I am using wkhtmltoimage with Xvfb.

Issue:

Well the screenshot process is working perfectly fine but the issue is utf8 & HTML5 video in my case are not working only in server (Amazon VPC) but working in my local machine

My first guess for UTF8 issue was to add the UTF8 local language support i.e. en_IN.UTF8 but this did not do the trick.

When I saw the issue with HTML5 video, I tried serching for default browser or rendering engine xvfb uses. I wasn't lucky there but found wkhtmltoimage uses QtWebkit rendering engine.

Tried check out difference in installed packages between my local (Ubuntu 13.04) & server ubuntu 12.04. I almost found all packages related to QtWebkit same.

Possible Solution:

I am guessing the issue may be of the Browser/Rendering Engine which is invoked while taking the screen shot.

Here is the code:

xvfb-run --server-args="-screen 0, 1024x680x24" wkhtmltoimage --use-xserver -f png --quality 94 --javascript-delay 2000 --disable-smart-width --zoom 0.8 --encoding "utf-8" --enable-plugins --width 650 --height 600 http://google.com new.png

Few online Documentation I referred:

wkhtmltoimage doc1
wkhtmltoimage doc2

I am adding the images which are created both in local and server. Well local one has all the details I am looking for.

Local Machine Screenshot:
Local Machine Screenshot


Amazon VPC Server Screenshot:
Amazon VPC Server Screenshot

Please guide me on this. I am stuck with this from past 20 hours.

Regards,
Hbksagar

P.S: I started using xvfb because of the following errors while using wkhtmltoimage only such as:

  • QWidget: Cannot create a QWidget when no GUI is being used
  • QPixmap: Cannot create a QPixmap when no GUI is being used

with reference to This Article

Hbksagar
  • 548
  • 7
  • 17

2 Answers2

1

Ensure that the font-related packages are the same at both machines and that you have fontconfig configured similarly. Using the latest 0.12.1 binaries is also recommended.

ashkulz
  • 792
  • 3
  • 6
  • Thank you for the answer. I have installed almost all required fonts & the library is working handsomely in the local machine. – Hbksagar Jul 04 '14 at 06:10
  • 1
    ttf-indic-fonts finally did the trick for the font issue. But still not able to figure out HTML5 video support issue. – Hbksagar Jul 09 '14 at 13:20
1

Please for UTF issue please try to install

yum install "@Chinese Support"

This will work for the groups below:

Arabic
Armenian
Bengali
Burmese
Chinese
Ethiopic
Georgian
Greek
Gujarati
Hebrew
Japanese
Kannada
Khmer
Korean
Lao
Malayalam
Oriya
Russian
Tamil
Telugu
Thai

It works for me.

Danubian Sailor
  • 1
  • 38
  • 145
  • 223
Dipa
  • 19
  • 2