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.
Run npm install
Run node index.js
Papyrus exposes some POST
endpoints for pdf generation:
/pdf
: The webpage to be printed is provided as the request body paramwebURL
.
Sample request:
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
.
/html2pdf
: The webpage to be printed is provided as an HTML file with any key.
Sample request:
curl --location --request POST 'localhost:3000/html2pdf' \
--form 'file=@"/path/to/file/Or/Use/sample.html/from/this/repo"' > download.pdf
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.