@cityssm/pdf-form-extract
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

PDF Form Extract

npm (scoped) Codacy Badge Maintainability Test Coverage GitHub Workflow Status Snyk Vulnerabilities for GitHub Repo

Extracts PDF form fields into a Javascript object.

Installation

npm install @cityssm/pdf-form-extract

Usage

PDF Screenshot

import extractFormFields from "@cityssm/pdf-form-extract"

const data = await extractFormFields('test/testForm.pdf')
console.log(data)

const dataWithOptions = await extractFormFields('test/testForm.pdf', { useFieldName: true })
{
  "Contractor Firm Name": "The City of Sault Ste. Marie",
  "Address": "https://github.com/cityssm/pdf-form-extract",
  "Contractor Representative Print Name": "Dan Gowans",
  "Date": "2023-01-13"
}

Optional Options

useFieldName
Default = false
Uses the field name (provided by the Form API) as the Object key instead of the field key.

Notes

For the best results, the form fields in the PDF should be properly labelled.

Package Sidebar

Install

npm i @cityssm/pdf-form-extract

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

14.2 kB

Total Files

12

Last publish

Collaborators

  • dgowans