How to Install wkhtmltopdf?

廉价感情. 提交于 2019-12-06 09:54:19
Sunny

Installing wkhtmltopdf

on Ubuntu Linux machine

  1. First check os is 32 bit or 64 bit by using following command

    Try uname -m. It seems like the uname -m actually gives x86_64 when it is an kernel 64 bits

  2. Run following command

    sudo apt-get install openssl build-essential xorg libssl-dev libxrender-dev
    
  3. Then run following command

    sudo apt-get install wkhtmltopdf
    
  4. Based on OS download wkhtmltopdf package from following site

    http://code.google.com/p/wkhtmltopdf/downloads/list

    OR

    wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz2
    

    (wkhtmltopdf-0.9.9-static-i386.tar.bz2 is a stable release for wkhtmltopdf )

  5. Then extract using command

    tar xvjf wkhtmltopdf-0.9.9-static-i386.tar.bz2
    
  6. Then move extracted DIR to usr/local/bin folder

    sudo mv wkhtmltopdf-i386 /usr/local/bin/wkhtmltopdf
    
  7. Check wkhtmltopdf is install or not using following command

    which wkhtmltopdf
    wkhtmltopdf –help
    

Installing wkhtmltopdf on MacOs

brew install Caskroom/cask/wkhtmltopdf

Another way to use official binaries within Rails is adding the following line to your Gemfile:

gem 'wkhtmltopdf-installer'

This way the official binaries from http://wkhtmltopdf.org will be downloaded and added to your bundle during bundle install phase.

hlcfan

I encountered this problem this morning.

Before you do anything, please check out: https://github.com/pdfkit/pdfkit/wiki/Installing-WKHTMLTOPDF

  1. Download a binary edition of wkhtmltopdf at http://code.google.com/p/wkhtmltopdf/downloads/list

  2. Decompress the package.

  3. Copy the file like wkhtmltopdf-i386 to /usr/local/bin/ & /opt/ (also you could make soft link).

  4. That's done.

Good luck.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!