Comments (4)
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.
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.
@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.
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)
- Encoded URI's not accepted in GET "url" parameter
- selector for PDF like screenshot.selector query
- Procfile not working out of the box with Dokku
- PDF name is always "render" can we change it? HOT 2
- jpeg screenshot with selector
- Are get links allowed ? HOT 3
- pdf.fullPage=true is not working in Demo
- Why bluebird?
- Cloudflare protection HOT 1
- Application error HOT 3
- width and height and screen size in api URL HOT 1
- Is there a way to make only 1 page landscape but the rest portrait? HOT 1
- Potential security issue HOT 1
- Still Availabe? HOT 2
- Docs don't provide information about Adding Header/Footer to API service HOT 1
- Page break is not working properly HOT 3
- Some web pages display completion
- Updating puppeteer to support newer Chrome features HOT 4
- Basic Auth is not forwarded
- Footer and Header Template HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from url-to-pdf-api.