GithubHelp home page GithubHelp logo

hhy5277 / electron-pdf-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from janpot/electron-pdf

0.0 1.0 0.0 18 KB

Pdf rendering service based on atom/electron

Dockerfile 3.37% JavaScript 93.70% Shell 2.93%

electron-pdf-1's Introduction

electron-pdf

Pdf rendering service with electron

Usage

With Docker:

$ docker run -p 3000:3000 janpot/electron-pdf

Run locally

$ npm i -g electron-prebuilt
$ electron .

API

Endpoints

GET /:url

url: Absolute url to the webpage you want to have rendered.

$ curl http://localhost:3000/https://www.google.com > google.pdf

POST /

Send a html string as the request body.

$ curl -L https://www.google.com | curl -X POST -d @- http://localhost:3000/ > google.pdf

Options

Use following request headers to control the output pdf appearance.

  • x-pdf-orientation: landscape or portrait - Page orientation, defaults to portrait.
  • x-pdf-no-backgrounds: Presence of this header prevents backgrounds from being printed.
  • x-pdf-margins: default, none or minimum - Margin type, defaults to default.
  • x-pdf-pageSize: A4, A3, Legal, Letter or Tabloid - Paper size, defaults to A4.

electron-pdf-1's People

Contributors

janpot avatar mklinga avatar

Watchers

 avatar

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.