@panosoft/pdf-form-fill
Render filled PDF forms.
Last updated 4 years ago by panosoft .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @panosoft/pdf-form-fill 
SYNC missed versions from official npm registry.

PDF Form Fill

Render filled PDF forms.

Installation

npm install @panosoft/pdf-form-fill

API


render ( input )

Render a filled PDF form from a blank PDF form and a set of field values.

Returns a Promise that is fulfilled with the filled PDF form Buffer.

Arguments

  • input - An object.

    • formFile - A base64 encoded string that represents the PDF form to fill.

    • formData - An object containing key value pairs where the key is a field name, and the value is the field value.

Example

const co = require('co');
const fill = require('@panosoft/pdf-form-fill');
const fs = require('fs');

co(function * () {
  const input = {
    formFile: fs.readFileSync('path/to/form.pdf', 'base64'),
    formData: {
      field1: 'value1'
    }
  };
  const output = yield fill(input); //=> Filled PDF Buffer
  fs.writeFileSync('output.pdf', output);
});

CLI


pdfFormFill

Render a filled PDF form from a blank PDF form and a set of field values.

Reads input from stdin and writes the filled PDF form Buffer to stdout.

If an error is encountered, the error message and stack trace will be written to stderr and the process will exit with a code of 1.

Arguments

  • input - An stringified JSON object containing the following fields:

    • formFile - A base64 encoded string that represents the PDF form to fill.

    • formData - An object containing key value pairs where the key is a field name, and the value is the field value.

Example

$ echo '{"formFile":"JVBERi0...", "formData": {"field1": "value1", ...}}' | pdfFormFill > filledForm.pdf

Current Tags

  • 0.1.5                                ...           latest (4 years ago)

6 Versions

  • 0.1.5                                ...           4 years ago
  • 0.1.4                                ...           4 years ago
  • 0.1.3                                ...           5 years ago
  • 0.1.2                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |