NodeJS library to convert JSON to PDF or vice versa (JSON to PDF or PDF to JSON)
Inspired from pdffiller.
This is dependent on the PDF Toolkit library PDF ToolKit So you should install PDF Toolkit first.
// with npm
npm install --save-dev form-pdf2json
// with yarn
yarn add form-pdf2json
Name | Desc | Misc |
---|---|---|
FieldType | Form Field Type | One of Text , Choice , Button |
FieldName | Form Field Name | Unique |
FieldStateOption | If FieldType is Button, actual value is FieldStateOption's value |
- |
FieldValue | - | - |
var pdf2json = require("form-pdf2json");
// or
import pdf2json from "form-pdf2json";
// => { convertPdf2Json: [Function], convertJson2Fdf: [Function], ... }
convertPdf2Json
pdf2json.convertPdf2Json("path/to/file");
// returns json data
convertJson2Fdf
pdf2json.convertJson2Fdf("path/to/file");
// returns fdf data
exportPdf2Json
pdf2json.exportPdf2Json("path/to/file");
// export json file
exportJson2Pdf
pdf2json.exportJson2Pdf("path/to/file");
// export json file
exportPdf2Fdf
pdf2json.exportPdf2Fdf("path/to/file");
// export json file
Feel free to contribute by posting issues or pull requests on form-pdf2json