When I generate a PDF or image using:
image_api_response = a2p_client.Chrome.html_to_image(html, file_name=image_filename)
pdf_api_response = a2p_client.Chrome.html_to_pdf(html,file_name=pdf_filename,)
To download the file I try to use image_api_response.download_pdf() or pdf_api_response.download_pdf() I get the following error:
File "/usr/local/lib/python3.8/site-packages/api2pdf/api2pdf.py", line 158, in download_pdf
if self.result['success']:
The immediate fix:
|
if self.result['success']: |
should reference
Success not
success
I also recommend a change in this method's name since it isn't only used to download images. Perhaps download_file.
When I generate a PDF or image using:
To download the file I try to use
image_api_response.download_pdf()orpdf_api_response.download_pdf()I get the following error:The immediate fix:
api2pdf.python/api2pdf/api2pdf.py
Line 158 in 05ea971
should reference
SuccessnotsuccessI also recommend a change in this method's name since it isn't only used to download images. Perhaps
download_file.