Closed postgetme closed 5 years ago
I believe 'render.pdf' comes from the browser which uses the last segment of the url (i.e. /api/render/) as the default file name. You have a few options:
attachmentName
parameter with the desired filename (note: this will set the Content-Disposition header to attachment which means the browser will show a download prompt instead of rendering the pdf in-window)I tried to use "https://url-to-pdf-api.herokuapp.com/api/render?url=http://google.com&attachmentName=google.pdf", but got {"status":400,"statusText":"Bad Request","errors":[{"field":["attachmentName"],"location":"query","messages":["\"attachmentName\" is not allowed"],"types":["object.allowUnknown"]}]}
@postgetme The attachment name parameter was added fairly recently (around November) and I don't think the herokuapp has been updated to reflect the change. You would need to clone the project and run the service on your own machine
The heroku app is updated whenever master is updated unless there's a build error. It works now.
I noticed the default file name is render.pdf, but how can I specific custom file name?