Skip to content

Issue when trying to download a file (typo) #9

@CamLamb

Description

@CamLamb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions