Pdf rendering service with electron
With Docker:
$ docker run -p 3000:3000 janpot/electron-pdfRun locally
$ npm i -g electron-prebuilt
$ electron .url: Absolute url to the webpage you want to have rendered.
$ curl http://localhost:3000/https://www.google.com > google.pdfSend a html string as the request body.
$ curl -L https://www.google.com | curl -X POST -d @- http://localhost:3000/ > google.pdfUse following request headers to control the output pdf appearance.
x-pdf-orientation:landscapeorportrait- Page orientation, defaults toportrait.x-pdf-no-backgrounds: Presence of this header prevents backgrounds from being printed.x-pdf-margins:default,noneorminimum- Margin type, defaults todefault.x-pdf-pageSize:A4,A3,Legal,LetterorTabloid- Paper size, defaults toA4.
Released under MIT License