NodeJS library to convert pdf to json or vice versa
npm install form-pdf2json!NPM
!GitHub package.json version
NodeJS library to convert JSON to PDF or vice versa (JSON to PDF or PDF to JSON)
Inspired from pdffiller.
- Requirements
- Installation
- Definition
- Usage
- Commands
- Convert file to data
- PDF to JSON
- JSON to FDF
- Export to file
- PDF to JSON
- PDF to FDF
- JSON to PDF
This is dependent on the PDF Toolkit library PDF ToolKit
So you should install PDF Toolkit first.
``bash
// 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 |FieldType
| FieldName | Form Field Name | Unique |
| FieldStateOption | If is Button, actual value is FieldStateOption's value | - |
| FieldValue | - | - |
`javascript
var pdf2json = require("form-pdf2json");
// or
import pdf2json from "form-pdf2json";
// => { convertPdf2Json: [Function], convertJson2Fdf: [Function], ... }
`
#### PDF to JSON
convertPdf2Json
`javascript`
pdf2json.convertPdf2Json("path/to/file");
// returns json data
#### JSON to FDF
convertJson2Fdf
`javascript`
pdf2json.convertJson2Fdf("path/to/file");
// returns fdf data
#### PDF to JSON
exportPdf2Json
`javascript`
pdf2json.exportPdf2Json("path/to/file");
// export json file
#### JSON to PDF
exportJson2Pdf
`javascript`
pdf2json.exportJson2Pdf("path/to/file");
// export json file
#### PDF to FDF
exportPdf2Fdf
`javascript``
pdf2json.exportPdf2Fdf("path/to/file");
// export json file
Feel free to contribute by posting issues or pull requests on form-pdf2json