entity

package
v0.0.0-...-40a6ac2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	X      float64
	Y      float64
	Width  float64
	Height float64
}

Cell represents a cell inside the PDF.

func NewRootCell

func NewRootCell(pageWidth, pageHeight float64, margins Margins) Cell

NewRootCell creates the main Cell.

func (Cell) Copy

func (c Cell) Copy() Cell

Copy deep copy the cell data.

func (Cell) GetDimensions

func (c Cell) GetDimensions() *Dimensions

GetDimensions returns the dimensions of the Cell (width and height).

type Config

type Config struct {
	ProviderType         provider.Provider
	Dimensions           *Dimensions
	Margins              *Margins
	DefaultFont          *properties.Font
	CustomFonts          []*CustomFont
	GenerationMode       generation.Mode
	ChunkWorkers         int
	Debug                bool
	MaxGridSize          int
	PageNumber           *properties.PageNumber
	Protection           *Protection
	Compression          bool
	Metadata             *Metadata
	BackgroundImage      *Image
	DisableAutoPageBreak bool
}

Config is the configuration of a bpdf instance.

func (*Config) ToMap

func (c *Config) ToMap() map[string]interface{}

ToMap converts Config to a map[string]interface{} .

type CustomFont

type CustomFont struct {
	Family string
	Style  fontstyle.Fontstyle
	File   string
	Bytes  []byte
}

CustomFont representats a font that can be added to the pdf.

type Dimensions

type Dimensions struct {
	Width  float64
	Height float64
}

Dimensions is the representation of a width and height.

func (*Dimensions) AppendMap

func (d *Dimensions) AppendMap(label string, m map[string]interface{}) map[string]interface{}

AppendMap appends the dimensions to a map.

type Image

type Image struct {
	Bytes      []byte
	Extension  extension.Extension
	Dimensions *Dimensions
}

Image is the representation of an image that can be added to the pdf.

func (*Image) AppendMap

func (i *Image) AppendMap(m map[string]interface{}) map[string]interface{}

AppendMap adds the Image fields to the map.

type Margins

type Margins struct {
	Left   float64
	Right  float64
	Top    float64
	Bottom float64
}

Margins is the representation of a margin.

func (*Margins) AppendMap

func (m *Margins) AppendMap(mp map[string]interface{}) map[string]interface{}

AppendMap appends the margins to a map.

type Metadata

type Metadata struct {
	Author       *Utf8Text
	Creator      *Utf8Text
	Subject      *Utf8Text
	Title        *Utf8Text
	CreationDate *time.Time
	KeywordsStr  *Utf8Text
}

Metadata is the representation of a PDF metadata.

func (*Metadata) AppendMap

func (m *Metadata) AppendMap(mp map[string]interface{}) map[string]interface{}

AppendMap appends the metadata to a map.

type Protection

type Protection struct {
	Type          protection.Protection
	UserPassword  string
	OwnerPassword string
}

Protection is the representation of a pdf protection.

func (*Protection) AppendMap

func (p *Protection) AppendMap(m map[string]interface{}) map[string]interface{}

AppendMap adds the Protection fields to the map.

type Utf8Text

type Utf8Text struct {
	Text string
	UTF8 bool
}

Utf8Text representats a text with a flag to indicate if it's UTF8.

func (*Utf8Text) ToString

func (u *Utf8Text) ToString() string

ToString returns a string representation of the text.

Jump to

Keyboard shortcuts

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