signature

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package signature implements creation of signatures.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(value string, ps ...props.Signature) core.Component

New is responsible to create an instance of a Signature.

Example

ExampleNew demonstrates how to create a signature component.

package main

import (
	"github.com/flanksource/maroto/v2"
	"github.com/flanksource/maroto/v2/pkg/components/col"
	"github.com/flanksource/maroto/v2/pkg/components/signature"
)

func main() {
	m := maroto.New()

	signature := signature.New("signature label")
	col := col.New(12).Add(signature)
	m.AddRow(10, col)

	// generate document
}

func NewAutoRow

func NewAutoRow(value string, ps ...props.Signature) core.Row

NewRow is responsible to create an instance of a Signature wrapped in a automatic Row.

func NewCol

func NewCol(size int, value string, ps ...props.Signature) core.Col

NewCol is responsible to create an instance of a Signature wrapped in a Col.

Example

ExampleNewCol demonstrates how to create a signature component wrapped into a column.

package main

import (
	"github.com/flanksource/maroto/v2"
	"github.com/flanksource/maroto/v2/pkg/components/signature"
)

func main() {
	m := maroto.New()

	signatureCol := signature.NewCol(12, "signature label")
	m.AddRow(10, signatureCol)

	// generate document
}

func NewRow

func NewRow(height float64, value string, ps ...props.Signature) core.Row

NewRow is responsible to create an instance of a Signature wrapped in a Row.

Example

ExampleNewRow demonstrates how to create a signature component wrapped into a row.

package main

import (
	"github.com/flanksource/maroto/v2"
	"github.com/flanksource/maroto/v2/pkg/components/signature"
)

func main() {
	m := maroto.New()

	signatureRow := signature.NewRow(10, "signature label")
	m.AddRows(signatureRow)

	// generate document
}

Types

type Signature

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

func (*Signature) GetHeight

func (s *Signature) GetHeight(provider core.Provider, cell *entity.Cell) float64

GetHeight returns the height that the signature will have in the PDF

func (*Signature) GetStructure

func (s *Signature) GetStructure() *node.Node[core.Structure]

GetStructure returns the Structure of a Signature.

func (*Signature) Render

func (s *Signature) Render(provider core.Provider, cell *entity.Cell)

Render renders a Signature into a PDF context.

func (*Signature) SetConfig

func (s *Signature) SetConfig(config *entity.Config)

SetConfig sets the config.

Jump to

Keyboard shortcuts

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