在AWS ElasticBeanstalk上安装WKHTMLTOX(WKHTMLTOPDF WKHTMLTOIMAGE)

前端之家收集整理的这篇文章主要介绍了在AWS ElasticBeanstalk上安装WKHTMLTOX(WKHTMLTOPDF WKHTMLTOIMAGE)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我需要使用我的AWS EB应用程序安装WK HTMLTOX.
我找到了 this教程,除了支持旧版本外,它还可以工作.

有没有人在AWS EB上安装最新的(0.12.3)版本,因为这是一个有点不同的文件夹结构?

解决方法

在尝试了不同的教程之后,包括 this我终于得到了这个工作 – 我更新了porteaux的答案.

我将下面的代码添加到命令部分的EB * .config文件中:

  1. commands:
  2. # install WKHTML
  3. 03_command:
  4. command: yum install xz urw-fonts libXext openssl-devel libXrender
  5. 04_command:
  6. command: wget http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
  7. 05_command:
  8. command: tar -xJf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
  9. 06_command:
  10. command: cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
  11. 07_command:
  12. command: cp wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage

>以上教程适用于Ubuntu,AWS EB运行Amazon Linux,因此他们使用yum而不是apt-get
>我不得不使用J开关和tar命令来处理* .xz文件
>最后我不得不将wkhtmltopdf和wkhtmltoimage文件复制到bin文件夹.

完成!我希望这会有助于其他人.

更新:根据dhollenbeck的建议

  1. 04_command:
  2. command: wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  3. test: test ! -f .wkhtmltopdf
  4. 05_command:
  5. command: tar -xJf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  6. test: test ! -f .wkhtmltopdf
  7. 06_command:
  8. command: cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
  9. test: test ! -f .wkhtmltopdf
  10. 07_command:
  11. command: cp wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage
  12. test: test ! -f .wkhtmltopdf
  13. 08_command:
  14. command: touch .wkhtmltopdf

我已经更新了我的脚本,可以确认这项工作.谢谢dhollenbeck

猜你在找的HTML相关文章