Skip to content

Commit febd42a

Browse files
committed
docs(README): document the usage of --chrome-binary
1 parent 37e1532 commit febd42a

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,30 @@ python -m html2pdf4doc.main get_driver --disable-ssl-check
4141
python -m html2pdf4doc.main print --disable-ssl-check input.html output.pdf
4242
```
4343

44+
### Pin a specific Chrome binary
45+
46+
Pin a specific Chrome/Chromium binary with `--chrome-binary`, for example to
47+
use Chrome for Testing or a binary in a non-standard location. Without this
48+
flag, `html2pdf4doc` auto-detects the Chrome/Chromium binary on the machine.
49+
50+
```bash
51+
python -m html2pdf4doc.main get_driver --chrome-binary /path/to/chrome
52+
python -m html2pdf4doc.main print --chrome-binary /path/to/chrome input.html output.pdf
53+
```
54+
55+
Set the `HTML2PDF4DOC_CHROME_BINARY` environment variable instead of the
56+
flag, for example in CI or Docker environments:
57+
58+
```bash
59+
export HTML2PDF4DOC_CHROME_BINARY=/path/to/chrome
60+
python -m html2pdf4doc.main print input.html output.pdf
61+
```
62+
63+
`html2pdf4doc` resolves the Chrome binary in this order:
64+
- `--chrome-binary`
65+
- `HTML2PDF4DOC_CHROME_BINARY`
66+
- auto-detection.
67+
4468
## Developer guide
4569

4670
### Getting started

0 commit comments

Comments
 (0)