0

When I want to replace the html file with a pdf, I get an error when I click run: module 'pdfkit' has no attribute 'configuration'

import pdfkit

path_wkhtmltopdf = 'C:\\Program Files\\wkhtmltopdf\\bin\\wkhtmltopdf.exe'
config = pdfkit.configuration(wkhtmltopdf=path_wkhtmltopdf)

options = {
    'zoom': 1.00,
    'page-size':'A3',
    'encoding':'utf-8', 
    'margin-top':'0cm',
    'margin-bottom':'0cm',
    'margin-left':'0cm',
    'margin-right':'0cm'
}


pdfkit.from_file(report.html,report.pdf,configuration=config,options=options)
MohitGhodasara
  • 2,342
  • 1
  • 22
  • 29

0 Answers0