fillpdf

package module
v0.0.0-...-a9f727d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

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 field values. Feel free to add support to more form types.

Documentation

Check the Documentation at GoDoc.org.

Sample

There is an example in the sample directory:

package main

import (
	"log"

	"github.com/desertbit/fillpdf"
)

func main() {
	// Create the form values.
	form := fillpdf.Form{
		"field_1": "Hello",
		"field_2": "World",
	}

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

Run the example as following:

cd sample
go build
./sample

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fill

func Fill(form Form, formPDFFile string) (result io.Reader, err error)

Fill fills a PDF form with the specified form values and creates a final filled PDF file.

func FillFromReader

func FillFromReader(form Form, pdfFile io.Reader) (result io.Reader, err error)

FillFromReader fills a PDF form with the specified form values and creates a final filled PDF file.

Types

type Form

type Form map[string]interface{}

Form represents the PDF form. This is a key value map.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL