Skip to main content

html2pdf-chromium

Convert HTML files or HTML strings to PDF using Chromium-based browsers(like Chrome or Edge) in headless mode without dependencies such as chromedriver.

✨ Features

  • 📄 Convert HTML files or strings to PDF
  • 🧠 Uses headless Chrome or Edge
  • 🧰 No additional Python dependencies — uses only the standard library
  • ❌ Does not require chromedriver or Selenium

📦 Installation

pip install html2pdf-chromium

Usage

PDF from HTML File

from html2pdf_chromium import Converter

converter = Converter()  # Uses Chrome by default
converter.convert_file("example.html", "output.pdf")

PDF from HTML String

from html2pdf_chromium import Converter

converter = Converter()  # Uses Chrome by default
content = """
<html>
  <body>
    <h1>Hello PDF!</h1>
    <p>This was generated from an HTML string.</p>
  </body>
</html>
"""
converter.convert_string(content, "output.pdf")

Selecting browser (used to detect executables in common paths)

from html2pdf_chromium import Converter

converter = Converter(browser="edge")
converter.convert_file("example.html", "output.pdf")

Using a custom path for other Chromium based browsers

from html2pdf_chromium import Converter

converter = Converter(executable_path="path_to_executable/chromium.exe") 
converter.convert_file("example.html", "output.pdf")

Metadata

Release files for html2pdf-chromium 0.1.3

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

Source distribution (sdist)

Source distribution for html2pdf-chromium 0.1.3
File Size Uploaded Provenance
html2pdf_chromium-0.1.3.tar.gz 5.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for html2pdf-chromium 0.1.3
File Interpreter ABI Platform
html2pdf_chromium-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / html2pdf_chromium-0.1.3.tar.gz

Download URL html2pdf_chromium-0.1.3.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c6fe993116e06598717ef5472ca05eb696edd5b92990540db0a6f17ef7f5b05c
BLAKE2b-256 checksum
How to use checksums
adec6f09d656f10ae638856be1960ad316118743f11f07e8ff202db66446c3f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release files / html2pdf_chromium-0.1.3-py3-none-any.whl

Download URL html2pdf_chromium-0.1.3-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31082da98383d98327e8b8254052b70bcd6c2924d7dfac2a7397d8b0f521dcd8
BLAKE2b-256 checksum
How to use checksums
448dea4957a689f637789d0a83d22d056abf0065df1451dfcffcfb22318f4607
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Security for html2pdf-chromium 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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