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

Cannot pass file list to `from_file` module

Open TorhamDev opened this issue 3 years ago • 0 comments
trafficstars

Hello.

When I try to use a list of files to create a PDF, I get the following error:

OSError: wkhtmltopdf exited with non-zero code 1. error:
Exit with code 1, due to unknown error.

my code :

from glob import glob
import pdfkit




options = {
    "enable-local-file-access": "",
    "margin-top": "0",
    "margin-bottom": "0",
    "margin-left": "0",
    "margin-right": "0",
    'page-size': 'Letter',
    'encoding': "UTF-8",

}
pdfkit.from_file(glob("*.html"), "out.pdf", options=options) # or ["1.html", "2.html"]

pdfkit : 1.0.0 python : 3.6.13 wkhtmltopdf : 0.12.6

TorhamDev avatar Nov 18 '22 10:11 TorhamDev