Package fjson

Overview ▾

Package fjson provides support for loading PDF form field data from JSON data/files.

type FieldData

FieldData represents form field data loaded from JSON file.

type FieldData struct {
    // contains filtered or unexported fields

func LoadFromJSON

func LoadFromJSON(r io.Reader) (*FieldData, error)

LoadFromJSON loads JSON form data from `r`.

func LoadFromJSONFile

func LoadFromJSONFile(filePath string) (*FieldData, error)

LoadFromJSONFile loads form field data from a JSON file.

func LoadFromPDF

func LoadFromPDF(rs io.ReadSeeker) (*FieldData, error)

LoadFromPDF loads form field data from a PDF.

func LoadFromPDFFile

func LoadFromPDFFile(filePath string) (*FieldData, error)

LoadFromPDFFile loads form field data from a PDF file.

func (*FieldData) FieldImageValues

func (fd *FieldData) FieldImageValues() (map[string]*model.Image, error)

FieldImageValues implements model.FieldImageProvider interface.

func (*FieldData) FieldValues

func (fd *FieldData) FieldValues() (map[string]core.PdfObject, error)

FieldValues implements model.FieldValueProvider interface.

func (FieldData) JSON

func (fd FieldData) JSON() (string, error)

JSON returns the field data as a string in JSON format.

func (*FieldData) SetImage

func (fd *FieldData) SetImage(fieldName string, img *model.Image, opt []string) error

SetImage assign model.Image to a specific field identified by fieldName.

func (*FieldData) SetImageFromFile

func (fd *FieldData) SetImageFromFile(fieldName string, imagePath string, opt []string) error

SetImageFromFile assign image file to a specific field identified by fieldName.