Giter VIP home page Giter VIP logo

Comments (4)

nicky9door avatar nicky9door commented on May 13, 2024

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:

  • Change the endpoint in router.js to the desired name
  • Use a reverse proxy (Apache, Nginx) to route a path with the desired name to url-to-pdf-api
  • Use the 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)

from url-to-pdf-api.

postgetme avatar postgetme commented on May 13, 2024

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

from url-to-pdf-api.

nicky9door avatar nicky9door commented on May 13, 2024

@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

from url-to-pdf-api.

kimmobrunfeldt avatar kimmobrunfeldt commented on May 13, 2024

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

from url-to-pdf-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.