Skip to content

Commit dc69d55

Browse files
authored
Merge pull request #11 from jafacakes2011/rename-download-pdf
Rename download_pdf to download_file
2 parents bc5aabb + 9982b2e commit dc69d55

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ To use the merge endpoint, supply a list of urls to existing PDFs. The engine wi
224224

225225
## <a name="helpers"></a>Helper Methods
226226

227-
**Api2PdfResponse: download_pdf()**
227+
**Api2PdfResponse: download_file()**
228228

229-
On any `Api2PdfResponse` that succesfully generated a pdf, you can use the handy `download_pdf()` method to download the pdf to a file-like object which you can then save to your local cache. If the pdf generation was unsuccessful, it will throw a FileNotFoundException.
229+
On any `Api2PdfResponse` that succesfully generated a pdf, you can use the handy `download_file()` method to download the pdf to a file-like object which you can then save to your local cache. If the pdf generation was unsuccessful, it will throw a FileNotFoundException.
230230

231231
```
232232
from api2pdf import Api2Pdf
@@ -236,7 +236,7 @@ a2p_client = Api2Pdf('YOUR-API-KEY')
236236
links_to_pdfs = ['https://LINK-TO-PDF', 'https://LINK-TO-PDF']
237237
merge_result = a2p_client.PdfSharp.merge(links_to_pdfs)
238238
239-
pdf_as_file_object = merge_result.download_pdf()
239+
pdf_as_file_object = merge_result.download_file()
240240
```
241241

242242
**Delete a PDF on Command with delete(response_id)**

api2pdf/api2pdf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def request(self):
153153
def result(self):
154154
return self._result
155155

156-
def download_pdf(self):
156+
def download_file(self):
157157
USERAGENT = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
158158
if self.result['Success']:
159159
downloaded_file = requests.get(self.result['FileUrl'], headers=USERAGENT)

0 commit comments

Comments
 (0)