Skip to main content

Python client for HTML2PDF4Doc JavaScript library.

Project description

html2pdf4doc_python

html2pdf4doc_python is the Python wrapper/CLI for the html2pdf4doc JavaScript library that prints HTML pages into PDFs using Chrome/Chromedriver.

This repository focuses strictly on the Python-side automation layer. The rendering logic remains in the JS core.

Installation

  1. Install Google Chrome (or Chrome for Testing) on the machine that will run the CLI.

  2. Install the package from PyPI:

pip install html2pdf4doc

Python 3.8+ is required.

See also: the Ubuntu-based container Dockerfile and the GitHub CI files found in the .github/workflows folder.

Usage

TBD

Developer guide

Getting started

1. (Optional) Create and activate a virtual environment

python -m venv .venv && source .venv/bin/activate

2. Install the dependencies

git clone https://github.com/strictdoc-project/html2pdf4doc_python.git
cd html2pdf4doc_python

# Bootstrap minimal Python dependencies: Invoke and TOML.
pip install invoke toml

# Install all Python dependencies and update the submodule with the html2pdf4doc.js.
invoke bootstrap

3. The JS library is maintained in a Git submodule submodules/html2pdf.

When the submodule is updated after a release or during the development, rebuild the JS library, i.e., regenerate the html2pdf4doc.min.js:

invoke build

4. To validate changes, use the following commands:

invoke lint
invoke test  # Normal tests.
invoke test-fuzz  # More robust testing.

License

The project is distributed under the Apache License 2.0 (see LICENSE).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

html2pdf4doc-0.0.26.tar.gz (56.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

html2pdf4doc-0.0.26-py3-none-any.whl (58.7 kB view details)

Uploaded Python 3

File details

Details for the file html2pdf4doc-0.0.26.tar.gz.

File metadata

  • Download URL: html2pdf4doc-0.0.26.tar.gz
  • Upload date:
  • Size: 56.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.20

File hashes

Hashes for html2pdf4doc-0.0.26.tar.gz
Algorithm Hash digest
SHA256 6d53ae995b38bc13d1830b5885dae9b3ec75aff116d4d3d9fb58ebb84d31b1c3
MD5 80e9d09a8aef48ca3e9393533a74eddc
BLAKE2b-256 b2e28738751c8f949b34942800c599c11a311707371fc9b338a285f75a5fa3ad

See more details on using hashes here.

File details

Details for the file html2pdf4doc-0.0.26-py3-none-any.whl.

File metadata

  • Download URL: html2pdf4doc-0.0.26-py3-none-any.whl
  • Upload date:
  • Size: 58.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.20

File hashes

Hashes for html2pdf4doc-0.0.26-py3-none-any.whl
Algorithm Hash digest
SHA256 3094f2f43c87ab2b73ebade69abaef12164441a46db631cf866457a10d9a4a8d
MD5 533a0b1c0495d83b82c9d0bcb0812a46
BLAKE2b-256 e2aa89cbf2ce8915084e6aea064f354ab2921104180ea6ac05e1377090c23c62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page