entity

package
v2.0.0-beta.10 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package entity contains all core entities.

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 NewRootContext

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

func (Cell) Copy

func (c Cell) Copy() Cell

func (Cell) GetDimensions

func (c Cell) GetDimensions() *Dimensions

type Config

type Config struct {
	ProviderType      provider.Type
	Dimensions        *Dimensions
	Margins           *Margins
	DefaultFont       *props.Font
	CustomFonts       []*CustomFont
	WorkersQuantity   int
	Debug             bool
	MaxGridSize       int
	PageNumberPattern string
	PageNumberPlace   props.Place
	Protection        *Protection
	Compression       bool
	Metadata          *Metadata
	BackgroundImage   *Image
}

Config is the configuration of a maroto 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.Type
	File   string
	Bytes  []byte
}

CustomFont is the representation of 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.Type
	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
}

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.Type
	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 is the representation of 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