Install WKHTMLTOX (WKHTMLTOPDF + WKHTMLTOIMAGE) on AWS ElasticBeanstalk

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Install WKHTMLTOX (WKHTMLTOPDF + WKHTMLTOIMAGE) on AWS ElasticBeanstalk



I need WKHTMLTOX to be installed with my AWS EB app.
I found this tutorial and it works except it supports old version.



Did anyone install the latest (0.12.3) version on AWS EB as this is a bit different folders structure?




4 Answers
4



After trying different tutorials, including this I finally got this working - I updated porteaux's answer.



I added below code to my EB *.config file in commands section:


commands:
# install WKHTML
03_command:
command: yum install xz urw-fonts libXext openssl-devel libXrender
04_command:
command: wget http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
05_command:
command: tar -xJf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
06_command:
command: cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
07_command:
command: cp wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage



Done! I hope this will help others.



UPDATE: as per dhollenbeck suggestion


04_command:
command: wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
test: test ! -f .wkhtmltopdf
05_command:
command: tar -xJf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
test: test ! -f .wkhtmltopdf
06_command:
command: cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
test: test ! -f .wkhtmltopdf
07_command:
command: cp wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage
test: test ! -f .wkhtmltopdf
08_command:
command: touch .wkhtmltopdf



I've updated my script already and can confirm that this work.
Thanks dhollenbeck



An updated answer for wkhtmltopdf 0.12.4 installed on 64bit Amazon Linux 2016.09 v3.3.0.



Create yaml file .ebextensions/wkhtmltopdf.config



If you only want to install wkhtmltopdf once to speed up subsequent deployments:



I have insufficient reputation to comment everywhere, so my apologies that this is another answer, rather than just a comment on @dhollenbeck answer. Happy to delete this if that is updated.



gna.org has shut down thus 04_command will fail. A working list of downloads is on wkhtmltopdf.org.



The updated YAML scripts would therefore be.



Create yaml file .ebextensions/wkhtmltopdf.config:


commands:
03_command:
command: yum install --assumeyes zlib fontconfig freetype X11
04_command:
command: wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
05_command:
command: tar -xJf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
06_command:
command: cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
07_command:
command: cp wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage



and if you only want to install wkhtmltopdf once to speed up subsequent deployments:


commands:
03_command:
command: yum install --assumeyes zlib fontconfig freetype X11
test: test ! -f .wkhtmltopdf
04_command:
command: wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
test: test ! -f .wkhtmltopdf
05_command:
command: tar -xJf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
test: test ! -f .wkhtmltopdf
06_command:
command: cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
test: test ! -f .wkhtmltopdf
07_command:
command: cp wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage
test: test ! -f .wkhtmltopdf
08_command:
command: touch .wkhtmltopdf


wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.centos6.x86_64.rpm

sudo yum install wkhtmltox-0.12.5-1.centos6.x86_64.rpm






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived