What is reportscript?
Reportscript serves as a library for generating PDF documents in both Node and Browser environments. It provides a fast, reliable way to render your multi-page, complex documents. What sets reportscript apart is its ability to support both .JS and .TS, as well as offering a wide range of features from page numbers, images, timestamps, watermarks, and more.
Check out the interactive demo feature to test out reportscript capabilities in real time. For a more in-depth guide, checkout developer documentation and api documentation.
Quickstart
- Install reportscript:
1
npm install reportscript - Import
renderPdf:1 2 3
import renderPdf from 'reportscript' import fs from 'fs' import path from 'path'
- Make your document:
1 2 3 4 5 6 7 8 9 10 11
const document = { sections: { tables: [ { rows: [{ data: ["hello world !!!"] }], }, ], }, }
- Render your PDF to a path:
1
2
const path = path.join("cool_name.pdf");
renderPdf(document,fs.createWriteStream(path))