Skip to main content

python-wkhtmltopdf

A simple python wrapper for the wkhtmltopdf lib (http://code.example.com/p/wkhtmltopdf/) with flash support.

Requirements

System:

  • Xvfd

  • wkhtmltopdf

  • flashplugin-nonfree

  • python 2.5+

Installation

wkhtmltopdf

  1. Install Xvfd:

    $ sudo apt-get install xvfb
  2. Install Fonts:

    $ sudo apt-get install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
  3. Install wkhtmltopdf:

    $ sudo apt-get install wkhtmltopdf
  4. Install flashplugin:

    $ sudo apt-get install flashplugin-nonfree

python-wkhtmltopdf

  1. From git:

    $ git clone git@github.com:qoda/python-wkhtmltopdf.git
    $ cd python-wkhtmltopdf
    $ python setup.py install

Usage

Simple Usage::

  1. Use from class:

    from wkhtmltopdf import WKHtmlToPdf
    
    wkhtmltopdf = WKHtmlToPdf(
        url='http://www.example.com',
        output_file='~/example.pdf',
    )
    wkhtmltopdf.render()
  2. Use from method:

    from wkhtmltopdf import wkhtmltopdf
    
    wkhtmltopdf(url='example.com', output_file='~/example.pdf')
  3. Use from commandline (installed):

    $ python -m wkhtmltopdf.main example.com ~/example.pdf

Required Arguments:

  • url - the url to convert to pdf

  • output_file - the pdf file that you want to create

Optional Arguments:

  • screen_resolution (default: [1024, 768])

  • color_depth (default: 24 (bit))

  • flash_plugin (default: True)

  • disable_javascript (default: False)

  • delay (default: 0 (secs))

  • orientation (default: Portrait)

  • dpi (default: 100)

  • no_background (default: False)

  • grayscale (default: False)

  • http_username (default: None)

  • http_password (default: None)

Authors:

Metadata

Release files for wkhtmltopdf 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wkhtmltopdf 0.1
File Size Uploaded
wkhtmltopdf-0.1.tar.gz 6.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for wkhtmltopdf 0.1
File Interpreter ABI Platform
wkhtmltopdf-0.1-py2.7.egg Legacy Egg format - - Details
wkhtmltopdf-0.1-py2.6.egg Legacy Egg format - - Details
wkhtmltopdf-0.1-py2.5.egg Legacy Egg format - - Details

Total release size: 39.7 kB

Release files / wkhtmltopdf-0.1.tar.gz

Download URL wkhtmltopdf-0.1.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8f36d7209a178139c2582d6edd884e865e5c81ed553637e9d128a2c3003cd76b
BLAKE2b-256 checksum
How to use checksums
3eeebeb56ae5263f5358ac1d4fa060cbfeb462b08bd460d768ddc6fa5034de82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / wkhtmltopdf-0.1-py2.7.egg

Download URL wkhtmltopdf-0.1-py2.7.egg
Size 11.0 kB
Tags Egg
SHA-256 checksum
How to use checksums
b792e805af304341059a68ffc3ab175a39ad8dbf87e193c48da26b41a858dee8
BLAKE2b-256 checksum
How to use checksums
b7903ff1228a8ac5972061d1d8a4a6223e04495a6fe0f8ece3dcc3260ca76139
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / wkhtmltopdf-0.1-py2.6.egg

Download URL wkhtmltopdf-0.1-py2.6.egg
Size 11.0 kB
Tags Egg
SHA-256 checksum
How to use checksums
83ede785bc9733c36cc4266e27a7f6c499fb7842201f82f73c0475fbf9a51157
BLAKE2b-256 checksum
How to use checksums
5bbdd07c0b0752d51ec9898b376b6a64aebd8f0b091403dfbe5e3b70ab2ed0ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / wkhtmltopdf-0.1-py2.5.egg

Download URL wkhtmltopdf-0.1-py2.5.egg
Size 11.0 kB
Tags Egg
SHA-256 checksum
How to use checksums
8cb6a02643b225b60c9cfe0b70b17ce7f130bcdb66d22719ed475c9775edada0
BLAKE2b-256 checksum
How to use checksums
e01ecbbb44ecac189f8d601e8757f957c3175a1944574ec9555ff52dad9df53e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.2

4 release files

This release

0.1 This release

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page