GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - AppPress/pdffiller: Take an existing PDF Form and data and PDF Filler will create a new PDF with all given fields populated.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

80 Commits
80 Commits

Folders and files

NameName
Last commit message
Last commit date
test
test
 
 
.DS_Store
.DS_Store
 
 
.eslintrc
.eslintrc
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
index.js
index.js
 
 
package.json
package.json
 
 

Repository files navigation

PDF Filler (Node.js) ====== A node.js PDF form field data filler and FDF generator toolkit. This essentially is a wrapper around the PDF Toolkit library PDF ToolKit. On OS X 10.11, you must use this version: https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg Quick start ----------- First, run `npm install pdffiller --save` for your app. Then: ```js var pdfFiller = require('pdffiller'); // ... ``` ##Examples #### 1.Fill PDF with existing FDF Data ````javascript var pdfFiller = require('pdffiller'); var sourcePDF = "test/test.pdf"; var outputPDF = "test/test_complete.pdf"; var data = { "last_name" : "John", "first_name" : "Doe", "date" : "Jan 1, 2013", "football" : "Off", "baseball" : "Yes", "basketball" : "Off", "hockey" : "Yes", "nascar" : "Off" }; pdfFiller.fillForm( sourcePDF, outputPDF, data, function(err) { if (err) throw err; console.log("In callback (we're done)."); }); ```` This will take the test.pdf, fill the fields with the data values and create a complete filled in PDF (test_complete.pdf) #### 2. Generate FDF from PDF ````javascript var pdfFiller = require('pdffiller'); var sourcePDF = "test/test.pdf"; pdfFiller.getFdf( sourcePDF, function(err, fdf) { if (err) throw err; console.log(fdf); }); ```` This will print out: ````'%FDF-1.2%âãÏÓ 1 0 obj << /FDF << /Fields [<< /V() /T(first_name) >><< /V() /T(last_name) >><< /V() /T(date) >><< /V() /T(football) >><< /V() /T(baseball) >><< /V() /T(basketball) >><< /V() /T(nascar) >><< /V() /T(hockey) >>] >> >> endobj trailer << /Root 1 0 R >> %%EOF '```` #### 3. Query PDF for form fields ````javascript var pdfFiller = require('pdffiller'), sourcePDF = "test/test.pdf", FDF_data, destinationPDF = "test/test_complete.pdf"; pdfFiller.getFormFields( sourcePDF, function(err, formFields) { if (err) throw err; console.log(formFields); }); ```` This will print out: ``` [ { fieldType: 'Text', fieldName: 'first_name', fieldFlags: '0', fieldJustification: 'Left' }, { fieldType: 'Text', fieldName: 'last_name', fieldFlags: '0', fieldJustification: 'Left' }, { fieldType: 'Text', fieldName: 'date', fieldFlags: '0', fieldJustification: 'Left' }, { fieldType: 'Button', fieldName: 'football', fieldFlags: '0', fieldJustification: 'Left', fieldStateOption: 'Yes' }, { fieldType: 'Button', fieldName: 'baseball', fieldFlags: '0', fieldJustification: 'Left', fieldStateOption: 'Yes' }, { fieldType: 'Button', fieldName: 'basketball', fieldFlags: '0', fieldJustification: 'Left', fieldStateOption: 'Yes' }, { fieldType: 'Button', fieldName: 'nascar', fieldFlags: '0', fieldJustification: 'Left', fieldStateOption: 'Yes' }, { fieldType: 'Button', fieldName: 'hockey', fieldFlags: '0', fieldJustification: 'Left', fieldStateOption: 'Yes' } ]; ```

About

Take an existing PDF Form and data and PDF Filler will create a new PDF with all given fields populated.

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.