Is a HTML 2 PDF service powered by NestJS and Puppeteer (Headless Chrome)
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
POST http://localhost:3000/pdf/render-url
{
"url": "https://www.google.gr", // Url to navigate and print to pdf.
"filename": "test.pdf", // Name of file to download.
"json": true, // false to force download stream file.
"options": {
"screen": false, // true for screen media and not print.
"page": {
"format": "A4", // Paper Format (A0, A1, A2 ...).
"landscape": false, // Orientation.
"height": null, // Custom Height of Page.
"width": null // Custom Width of Page.
}
}
}
POST http://localhost:3000/pdf/render-html
{
"html": "<h1>.....", // HTML print when DOMReady event trigged.
"filename": "test.pdf", // Name of file to download.
"json": true, // false to force download stream file.
"options": {
"screen": false, // true for screen media and not print.
"page": {
"format": "A4", // Paper Format (A0, A1, A2 ...).
"landscape": false, // Orientation.
"height": null, // Custom Height of Page.
"width": null // Custom Width of Page.
}
}
}