Skip to content

A node module to fill out pdf forms (utf8 compatible).

License

Notifications You must be signed in to change notification settings

wassimsalib/fill-pdf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fill-js

Build Status

A node module to fill out pdf forms (utf8 compatible).

It uses pdftk to fill out pdf forms and ghostscript to convert embedded fonts to outlines to increase cross-device robustness.

Installation

npm install fill-pdf

Dependencies

You need to have the pdftk an gs binaries in your PATH.

Install on Mac OSX

  • To install PDFtk use the official installer or if you have homebrew-cask installed you can run brew cask install pdftk
  • To install Ghoscript via homebrew run :brew install ghostscript

Install on Ubuntu

sudo apt-get install pdftk ghostscript

Usage example (with express)

var fillPdf = require("fill-pdf");
var formDate = { FieldName: 'Text to put into form field' };
var pdfTemplatePath = "templates.pdf";

app.get('/filled_form.pdf', function(req, res) {
  fillPdf.generatePdf(formDate,pdfTemplatePath, function(err, output) {
    if ( !err ) {
      res.type("application/pdf");
      res.send(output);
    }
  });
});

Acknowledgements

based on utf8-fdf-generator

About

A node module to fill out pdf forms (utf8 compatible).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%