Is a HTML 2 PDF service powered by NestJS and Puppeteer (Headless Chrome)
yarn install
# development
yarn start
# watch mode
yarn start:dev
# production mode
yarn start:prod
# unit tests
yarn test
# e2e tests
yarn test:e2e
# test coverage
yarn 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.
}
}
}