Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HomeDirectory

func HomeDirectory() (*string, error)

func MergePDF

func MergePDF(dir string, out string, in ...string) error

Types

type FDFGenerator

type FDFGenerator struct {
	// contains filtered or unexported fields
}

    TempPDFDir manage PDF Inject process

    func NewFDFGenerator

    func NewFDFGenerator(dir, prefix string) (*FDFGenerator, error)

      NewFDFGenerator Create a FDF Generator.

      func (*FDFGenerator) CreateFDFFile

      func (t *FDFGenerator) CreateFDFFile(form map[string]interface{}) (string, error)

        CreateFDFFile Create a temporary fdf file

        func (*FDFGenerator) GetTempOutputFile

        func (t *FDFGenerator) GetTempOutputFile() string

          GetTempOutputFile get temp output file for pdf

          func (*FDFGenerator) Remove

          func (t *FDFGenerator) Remove()

            Remove delete temp directory when finish process

            type InputType

            type InputType int
            const (
            	XFDF InputType = 0
            	FDF            = 1
            )

            type PDFInject

            type PDFInject struct {
            	// contains filtered or unexported fields
            }

            func New

            func New() PDFInject

            func NewWithDestFile

            func NewWithDestFile(destPDFFile string) PDFInject

            func (PDFInject) Fill

            func (pdf PDFInject) Fill(form map[string]interface{}, formPDFFile string) (*string, error)

            func (PDFInject) FillModel

            func (pdf PDFInject) FillModel(model interface{}, formPDFFile string) (*string, error)

            func (PDFInject) FillModelWithDestFile

            func (pdf PDFInject) FillModelWithDestFile(model interface{}, formPDFFile string, destPDFFile string) (*string, error)

            func (PDFInject) FillWithDestFile

            func (pdf PDFInject) FillWithDestFile(form map[string]interface{}, formPDFFile, destPDFFile string) (*string, error)

            func (PDFInject) SetInputType

            func (pdf PDFInject) SetInputType(in InputType)

            func (PDFInject) SetOverWrite

            func (pdf PDFInject) SetOverWrite(canOverwrited bool)

              SetOverWrite allow overWrite to Destination file

              func (PDFInject) Stamp

              func (pdf PDFInject) Stamp(stampPDFFile, srcPDFFile string) error

              func (PDFInject) StampWithDestFile

              func (pdf PDFInject) StampWithDestFile(stampPDFFile, srcPDFFile, destPDFFile string) error

              type ShellCommand

              type ShellCommand struct {
              	// contains filtered or unexported fields
              }

              func NewShellCommand

              func NewShellCommand(name string) ShellCommand

              func (*ShellCommand) RunInPath

              func (s *ShellCommand) RunInPath(dir string, args ...string) error

                runCommandInPath runs a command and waits for it to exit. The working directory is also set. The stderr error message is returned on error.

                func (*ShellCommand) RunInPathWithStd

                func (s *ShellCommand) RunInPathWithStd(dir string, stdInputFile string, stdOutputFile string, args ...string) error

                type TempFile

                type TempFile struct {
                	// contains filtered or unexported fields
                }

                func NewTempFile

                func NewTempFile(dir, prefix string) (*TempFile, error)

                  NewTempFile Create a FDF Generator.

                  func (*TempFile) GetTempOutputFilePath

                  func (t *TempFile) GetTempOutputFilePath() string

                    GetTempOutputFilePath Get a temporary output file path

                    func (*TempFile) Remove

                    func (t *TempFile) Remove()

                      Remove delete temp directory when finish process

                      type XFDFGenerator

                      type XFDFGenerator struct {
                      	// contains filtered or unexported fields
                      }

                        TempPDFDir manage PDF Inject process

                        func NewXFDFGenerator

                        func NewXFDFGenerator(dir, prefix string) (*XFDFGenerator, error)

                          NewXFDFGenerator Create a XFDF Generator.

                          func (*XFDFGenerator) CreateXFDFFile

                          func (t *XFDFGenerator) CreateXFDFFile(form map[string]interface{}) (string, error)

                            CreateXFDFFile Create a temporary fdf file

                            func (*XFDFGenerator) GetTempOutputFile

                            func (t *XFDFGenerator) GetTempOutputFile() string

                              GetTempOutputFile get temp output file for pdf

                              func (*XFDFGenerator) Remove

                              func (t *XFDFGenerator) Remove()

                                Remove all temp file when finish process