Skip to content
A sample project to demonstrate safe PDF rendering with Typescript
TypeScript HTML JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
templates
test
.gitignore
LICENSE
README.md
package-lock.json
package.json
preprocessor.js
tsconfig.json
tslint.json

README.md

PDF Generator Sample

This is a sample project to show how PDF files can be generated with PhantomJS and Puppeteer.

Provide means for rendering templates into HTML. Use PhantomJS or Puppeteer to render HTML files into PDF documents.

  • Docker
  • Node.js (prefer versions v8.9.3+)
  • Typescript

Base setup was copied from https://github.com/Microsoft/TypeScript-Node-Starter

Development

npm install
npm run dev

Each library should have types defined. If you are planning to use one without then you need to create a definitions file in src/types/. Prefer using dts-gen for that.

Testing

Jest is used for tests. Add new test files in test/ directory.

npm test

Production

npm install
npm run build
NODE_ENV=production npm start

Specificaton

Swagger spec is located in src/public/swagger.yaml.

  • Typescript models are generated by the spec
  • API models are validated by the spec
You can’t perform that action at this time.