2016-05-18 21 views

risposta

12

Dopo aver provato diversi tutorial, tra cui this ho finalmente ottenuto questo lavoro - ho aggiornato la risposta di porteaux.

ho aggiunto sotto il codice in un file il mio EB * .config nella sezione comandi:

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 
  1. È possibile che questo tutorial è per Ubuntu e AWS EB corre Amazon Linux in modo da utilizzare yum invece di apt-get
  2. Ho dovuto utilizzare l'opzione J con il comando tar per gestire il file * .xz
  3. Infine ho dovuto copiare entrambi i file wkhtmltopdf e wkhtmltoimage nella cartella bin.

Fatto! Spero che questo aiuti gli altri.

UPDATE: come da dhollenbeck suggerimento

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 

ho aggiornato il mio script già e posso confermare che questo lavoro. Grazie dhollenbeck

3

Una risposta aggiornata per wkhtmltopdf 0.12.4 installato su 64 bit Amazon Linux 2016.09 v3.3.0.

Creare .ebextensions file YAML/wkhtmltopdf.config

 
commands: 
    03_command: 
    command: yum install --assumeyes zlib fontconfig freetype X11 
    04_command: 
    command: wget http://download.gna.org/wkhtmltopdf/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 

Se si desidera solo installare wkhtmltopdf volta ad accelerare le implementazioni successive:

 
commands: 
    03_command: 
    command: yum install --assumeyes zlib fontconfig freetype X11 
    test: test ! -f .wkhtmltopdf 
    04_command: 
    command: wget http://download.gna.org/wkhtmltopdf/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 

3

devo insufficienti reputazione di commentare ovunque, quindi mi scuso che questa è un'altra risposta, piuttosto che un semplice commento sulla risposta di @dhollenbeck. Felice di cancellare questo se questo viene aggiornato.

gna.org si è spento così 04_comando avrà esito negativo. A working list of downloads è su wkhtmltopdf.org.

Gli script YAML aggiornati sarebbero quindi.

Crea .ebextensions file YAML/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 

e se desideri solo installare wkhtmltopdf volta ad accelerare le implementazioni successive:

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