config

package
v2.0.0-alpha.24 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MIT Imports: 12 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	WithPageSize(size pagesize.Type) Builder
	WithDimensions(width float64, height float64) Builder
	WithMargins(left float64, top float64, right float64) Builder
	WithProvider(providerType provider.Type) Builder
	WithWorkerPoolSize(poolSize int) Builder
	WithDebug(on bool) Builder
	WithMaxGridSize(maxGridSize int) Builder
	WithDefaultFont(font *props.Font) Builder
	TryLoadRepository(repository Repository) (Builder, error)
	WithPageNumber(pattern string, place props.Place) Builder
	WithProtection(protectionType protection.Type, userPassword, ownerPassword string) Builder
	WithCompression(compression bool) Builder
	WithOrientation(orientation orientation.Type) Builder
	WithAuthor(author string, isUTF8 bool) Builder
	WithCreator(creator string, isUTF8 bool) Builder
	WithSubject(subject string, isUTF8 bool) Builder
	WithTitle(title string, isUTF8 bool) Builder
	WithCreationDate(time time.Time) Builder
	Build() *Config
}

func NewBuilder

func NewBuilder() Builder

type Config

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

type CustomFont

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

type Dimensions

type Dimensions struct {
	Width  float64
	Height float64
}

type Margins

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

func (*Margins) Print

func (m *Margins) Print()

type Metadata

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

type Protection

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

type Repository

type Repository interface {
	AddUTF8Font(family string, style fontstyle.Type, file string) Repository
	Load() ([]*CustomFont, error)
}

func NewRepository

func NewRepository() Repository

type Utf8Text

type Utf8Text struct {
	Text string
	UTF8 bool
}

Jump to

Keyboard shortcuts

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