Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/meghajit/papyrus
Papyrus is an application to save a pdf version of any webpage.
https://github.com/meghajit/papyrus
chromium generator pdf pupeteer website
Last synced: about 2 months ago
JSON representation
Papyrus is an application to save a pdf version of any webpage.
- Host: GitHub
- URL: https://github.com/meghajit/papyrus
- Owner: Meghajit
- License: mit
- Created: 2021-07-31T20:04:18.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-12T09:49:33.000Z (over 3 years ago)
- Last Synced: 2023-05-03T08:29:28.338Z (almost 2 years ago)
- Topics: chromium, generator, pdf, pupeteer, website
- Language: JavaScript
- Homepage:
- Size: 35.2 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Papyrus
> _Reading furnishes the mind only with materials of knowledge; it is thinking that makes what we read ours._
>
>-- _John Locke_Papyrus is an application to save a pdf version of any webpage.
## Usage
### 1. Install dependencies
Run `npm install`### 2. Start the server
Run `node index.js`## API
Papyrus exposes some `POST` endpoints for pdf generation:1. `/pdf`: The webpage to be printed is provided as the request body param `webURL`.
Sample request:
```shell
curl --location --request POST 'localhost:3000/pdf' --header 'Content-Type: application/json' --data-raw '{
"webURL": "https://en.wikipedia.org/wiki/Papyrus"
}' > download.pdf
```
The pdf is written to the file `download.pdf`.2. `/html2pdf`: The webpage to be printed is provided as an HTML file with any key.
Sample request:
```shell
curl --location --request POST 'localhost:3000/html2pdf' \
--form 'file=@"/path/to/file/Or/Use/sample.html/from/this/repo"' > download.pdf
```## Disclaimer
The project could use a lot of improvements, some of which are mentioned in the issues. Feel free to add feature
requests if you want some functionality to be added or contribute to the project by raising a PR.