python-pdfkit icon indicating copy to clipboard operation
python-pdfkit copied to clipboard

Needed to enable local file access

Open purpleladydragons opened this issue 2 years ago • 3 comments

Hi, I'm not sure the best way to advertise this info going forward, but I had an issue my first time running pdfkit.from_file, getting the below error

OSError: wkhtmltopdf reported an error:
Exit with code 1 due to network error: ProtocolUnknownError

This issue in the wkhtmltopdf repo provides a solution.

It didn't necessarily take too much effort to find the options arg and provide the --enable-local-file-access option, but it also added some initial confusing friction to first usage.

If you want to just close, that's fine by me, but figured it'd be helpful to log this somewhere in case someone in the future has a similar issue!

purpleladydragons avatar May 16 '22 02:05 purpleladydragons

You can specify all wkhtmltopdf options. You can drop ‘–’ in option name. If option without value, use None, False or ‘’ for dict value:

options={'enable-local-file-access': None}

Korolev-Oleg avatar Aug 23 '22 19:08 Korolev-Oleg

this dosen't work for me :(

BenjaminHoegh avatar Sep 20 '22 08:09 BenjaminHoegh

You can specify all wkhtmltopdf options. You can drop ‘–’ in option name. If option without value, use None, False or ‘’ for dict value:

options={'enable-local-file-access': None}

i am using symfony and this doesnt work for me

ndukachukz avatar Apr 10 '23 20:04 ndukachukz