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

Add screenshot selector. Feature related to https://github.com/alvarc… #127

Closed nkimadusanka closed 4 years ago

nkimadusanka commented 4 years ago

…arto/url-to-pdf-api/issues/125 request

Add feature screenshot selector to support requested improvement https://github.com/alvarcarto/url-to-pdf-api/issues/125

Developer Comment

Samples

  1. Post request Example

curl --location --request POST 'http://localhost:9000/api/render' \ --header 'Content-Type: application/json' \ --header 'Content-Type: application/javascript' \ --data-raw '{ "output": "screenshot", "url": "https://expressjs.com/en/starter/hello-world.html", "screenshot": { "selector": "#license" } }'

  1. Get request example

http://localhost:9000/api/render?output=screenshot&screenshot.selector=%23license&url=https://expressjs.com/en/starter/hello-world.html

Note

tomasc commented 4 years ago

@nkimadusanka thanks a lot for making this PR, very kind of you!

kimmobrunfeldt commented 4 years ago

Thanks for your contribution! This was merged via #128.