{"id":24837,"library":"wkhtmltopdf","title":"wkhtmltopdf","description":"Simple Python wrapper for wkhtmltopdf that converts HTML to PDF using the wkhtmltopdf command-line tool. Version 0.2 is the latest release. The library has been in maintenance mode and is no longer actively developed.","status":"maintenance","version":"0.2","language":"python","source_language":"en","source_url":"https://github.com/qoda/python-wkhtmltopdf","tags":["wkhtmltopdf","pdf","html-to-pdf","wrapper","maintenance"],"install":[{"cmd":"pip install wkhtmltopdf","lang":"bash","label":"pip install wkhtmltopdf"}],"dependencies":[{"reason":"The library requires the wkhtmltopdf binary to be installed on the system.","package":"wkhtmltopdf (system tool)","optional":false}],"imports":[{"note":"","wrong":"","symbol":"wkhtmltopdf","correct":"import wkhtmltopdf"}],"quickstart":{"code":"import wkhtmltopdf\n# Convert HTML to PDF\nwith open('input.html', 'w') as f:\n    f.write('<h1>Hello World</h1>')\npdf = wkhtmltopdf.convert('input.html')\nwith open('output.pdf', 'wb') as f:\n    f.write(pdf)","lang":"python","description":"Basic example: convert an HTML file to PDF and write the output PDF."},"warnings":[{"fix":"Switch to a maintained library such as pdfkit (pip install pdfkit) or weasyprint.","message":"wkhtmltopdf is no longer actively maintained. Consider using alternatives like pdfkit, weasyprint, or selenium.","severity":"deprecated","affected_versions":"all"},{"fix":"Install wkhtmltopdf from https://wkhtmltopdf.org/downloads.html and ensure it is in your PATH.","message":"The library requires the wkhtmltopdf binary to be installed on your system and accessible in PATH. pip install does not install the binary.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install wkhtmltopdf from the official website and add it to PATH. Verify with 'which wkhtmltopdf' on Linux/Mac or 'where wkhtmltopdf' on Windows.","cause":"The wkhtmltopdf binary is not installed or not in your system's PATH.","error":"wkhtmltopdf.utils.WkHtmlToPdfError: 'wkhtmltopdf' not found in PATH"},{"fix":"Use 'import wkhtmltopdf' and call 'wkhtmltopdf.convert()'. Ensure no other wkhtmltopdf.py file shadows the library.","cause":"Incorrect import or usage. The module provides a direct function convert, but it's possible the user imported a different module with the same name.","error":"AttributeError: module 'wkhtmltopdf' has no attribute 'convert'"},{"fix":"Same as above: install wkhtmltopdf and add to PATH.","cause":"The wkhtmltopdf binary is not installed or not in PATH.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'wkhtmltopdf'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}