# alk-node-pdf-generator

> Pdf generator for node js

Latest version **1.0.2** (published 2022-02-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install alk-node-pdf-generator
pnpm add alk-node-pdf-generator
yarn add alk-node-pdf-generator
bun add alk-node-pdf-generator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-02-24 |
| First published | 2022-02-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | shehank |

## Links

- npm: https://www.npmjs.com/package/alk-node-pdf-generator
- Repository: https://github.com/shehanhasanga/alk-node-pdf-generator
- Homepage: https://github.com/shehanhasanga/alk-node-pdf-generator#readme
- Issues: https://github.com/shehanhasanga/alk-node-pdf-generator/issues
- npm.io page: https://npm.io/package/alk-node-pdf-generator

## Dependencies (4)

- [jszip](https://npm.io/package/jszip.md) ^3.1.5
- [jsreport-core](https://npm.io/package/jsreport-core.md) ^1.4.0
- [xslt-processor](https://npm.io/package/xslt-processor.md) ^0.11.5
- [jsreport-fop-pdf](https://npm.io/package/jsreport-fop-pdf.md) ^1.1.2

## Recent versions

- 1.0.2 (latest) — 2022-02-24
- 1.0.1 — 2022-02-24
- 1.0.0 — 2022-02-23

## README

"**alk-node-pdf-generator**" 

### Follow these steps to generate PDF

* Step 1 - install the pdf creator package using the following command


        npm i alk-node-pdf-generator
    
* Step 2 - Add required packages


        const pdfGenerator = require ('alk-node-pdf-generator')

        
* Step 3 - Make the xml file and respective xsl file for fo transformation.        
* Step 4 - call generatePdf with xml file path, xsl file path, output file path and file name. All there parameters should valid for the pdf generation

      
            pdfGenerator.generatePdf('File:\\assessment.xml', 'File:\\Sample.xsl', 'D:\\outputDir',"FileName") .then(function () {
                 console.log("pdf generated")
                  })
                  .catch(function (err) {
                      console.log(err)
                  });
* Step 5 - Add Fop library
    * Step 1 - Install Java Runtime Environment(JRE)
    * Download the latest zip file from http://mirrors.gigenet.com/apache/xmlgraphics/fop/binaries/ eg: fop-2.2-bin.zip 
    * Extract the zip file 
    * Modify "Path" OS environment variable to  fop folder eg: C:\Users\Admin\ Downloads\fop-2.2-bin\fop-2.2\fop 
    
* Step 6 - Run with node environment

       node script.js

---
_Source: https://npm.io/package/alk-node-pdf-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
