Post

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

  1. Install reportscript:
    1
    
    npm install reportscript
    
  2. Import renderPdf:
    1
    2
    3
    
    import renderPdf from 'reportscript'
    import fs from 'fs'
    import path from 'path'
    
  3. Make your document:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    
    const document = {
     sections: {
         tables: [
         {
             rows: [{
                 data: ["hello world !!!"] 
                 }],
             },
         ],
     },
    }
    
  4. Render your PDF to a path:
1
2
const path = path.join("cool_name.pdf");
renderPdf(document,fs.createWriteStream(path))