marciorf / fillpdf

FillPDF - Fill and multistamp PDF forms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FillPDF

FillPDF is a golang library to easily fill PDF forms. This library uses the pdftk utility to fill the PDF forms with fdf data. Currently this library only supports PDF text and checkbox field values. Feel free to add support to more form types (Send pull request to original developer) This fork extends with some more pdftk commands

  • Multistamp
  • Ability to generate PDF's with special characters (with flatten) with pdftk. (Limited by font in PDF)

Documentation

Check the Documentation at GoDoc.org.

Sample

There is an example:

package main

import (
	"log"

	"github.com/phelian/fillpdf"
)

func main() {
	// Create the form values.
	form := fillpdf.Form{
		"field_1": "Hello",
		"field_2": "World",
		"field_3": "with special åäöéè",
	}

	// Fill the form PDF with our values.
	err := fillpdf.Fill(form, "form.pdf", "filled.pdf", "On", "Off", true)
	if err != nil {
		log.Fatal(err)
	}
}

Run the example as following:

cd sample
go build
./sample

About

FillPDF - Fill and multistamp PDF forms

License:Apache License 2.0


Languages

Language:Go 100.0%