alvarcarto / url-to-pdf-api

Web page PDF/PNG rendering done right. Self-hosted service for rendering receipts, invoices, or any content.
MIT License
7.01k stars 774 forks source link

how to specific file name? #55

Closed postgetme closed 5 years ago

postgetme commented 6 years ago

I noticed the default file name is render.pdf, but how can I specific custom file name?

nicky9door commented 6 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:

postgetme commented 6 years ago

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"]}]}

nicky9door commented 6 years ago

@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

kimmobrunfeldt commented 5 years ago

The heroku app is updated whenever master is updated unless there's a build error. It works now.