Coder Social home page Coder Social logo

py-wkhtmltox's Introduction

Python bindings for the fabulous libwkhtmltox using Cython

Special thanks to antialize for creating wkhtmltopdf

For parameters and settings (for users familiar with the command line utility) see:

http://wkhtmltopdf.org/libwkhtmltox/pagesettings.html

Installation

$ python setup.py install

Tested on:

  • Mac OSX 10.6.4 Snow Leopard, Python 2.6.1 (32-bit and 64-bit)
  • CentOS 5.5, Python 2.6.4 (32-bit)
  • Windows 7, Python 2.7.6 (32-bit)

Pre-requisites on all platforms:

  • you need libwkhtmltox.* somewhere in your LD path (/usr/local/lib)
  • you need the directory include/wkhtmltox from wkhtmltopdf somewhere on your include path (/usr/local/include)

OSX Notes

If compiling for OSX (64-bit Python/libwkhtmltox only), until this bug is fixed you need the qt_menu.nib directory from the QT source tree in the same directory as your libwkhtmltox.* library files.

Windows Notes

You will need Visual Studio 2008 (VS2008 Express with SP1 and latest updates from Microsoft Update should work as well). Start a "Visual Studio 2008 Command Prompt" and run the following (assuming that wkhmltopdf is installed in C:\Program Files\wkhtmltopdf:

set INCLUDE=%INCLUDE%C:\Program Files\wkhtmltopdf\include;
set LIB=%LIB%C:\Program Files\wkhtmltopdf\lib;
python setup.py bdist_wininst

This would produce an installer in the dist/ folder which you can install. You will need to have C:\Program Files\wkhtmltopdf\bin in the path or copy wkhtmltox.dll along with the extension.

Cython

If you want to re-generate C source (or have made changes to the Cython template file, .pyx) you need Cython (tested with 0.13):

$ easy_install cython

Docker

$ docker build -f Dockerfile --target "dev" -t "py-wkhtmltox:dev" .
$ docker run -it -v $PWD/:/code/ --name pywk_dev py-wkhtmltox:dev bash
$ docker start pywk_dev
$ docker container exec -it pywk_dev bash

py-wkhtmltox's People

Contributors

mreiferson avatar ashkulz avatar leandrosilva avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.