wpdf

package
v0.0.465 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackgroundFill        = true
	BackgroundTransparent = false
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PDFBorder

type PDFBorder string
const (
	BorderNone   PDFBorder = ""
	BorderFull   PDFBorder = "1"
	BorderLeft   PDFBorder = "L"
	BorderTop    PDFBorder = "T"
	BorderRight  PDFBorder = "R"
	BorderBottom PDFBorder = "B"
	BorderTLR    PDFBorder = "TLR"
	BorderLR     PDFBorder = "LR"
)

type PDFCellOpt

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

func NewPDFCellOpt

func NewPDFCellOpt() *PDFCellOpt

func (*PDFCellOpt) Align

func (opt *PDFCellOpt) Align(v PDFTextAlign) *PDFCellOpt

func (*PDFCellOpt) AutoWidth

func (opt *PDFCellOpt) AutoWidth() *PDFCellOpt

func (*PDFCellOpt) AutoWidthPaddingX added in v0.0.461

func (opt *PDFCellOpt) AutoWidthPaddingX(v float64) *PDFCellOpt

func (*PDFCellOpt) Bold

func (opt *PDFCellOpt) Bold() *PDFCellOpt

func (*PDFCellOpt) Border

func (opt *PDFCellOpt) Border(v PDFBorder) *PDFCellOpt

func (*PDFCellOpt) BorderColor added in v0.0.460

func (opt *PDFCellOpt) BorderColor(cr, cg, cb int) *PDFCellOpt

func (*PDFCellOpt) BorderColorHex added in v0.0.460

func (opt *PDFCellOpt) BorderColorHex(c uint32) *PDFCellOpt

func (*PDFCellOpt) FillBackground

func (opt *PDFCellOpt) FillBackground(v bool) *PDFCellOpt

func (*PDFCellOpt) FillColor added in v0.0.460

func (opt *PDFCellOpt) FillColor(cr, cg, cb int) *PDFCellOpt

func (*PDFCellOpt) FillColorHex added in v0.0.460

func (opt *PDFCellOpt) FillColorHex(c uint32) *PDFCellOpt

func (*PDFCellOpt) Font

func (opt *PDFCellOpt) Font(fontName PDFFontFamily, fontStyle PDFFontStyle, fontSize float64) *PDFCellOpt

func (*PDFCellOpt) FontName

func (opt *PDFCellOpt) FontName(v PDFFontFamily) *PDFCellOpt

func (*PDFCellOpt) FontSize

func (opt *PDFCellOpt) FontSize(v float64) *PDFCellOpt

func (*PDFCellOpt) FontStyle

func (opt *PDFCellOpt) FontStyle(v PDFFontStyle) *PDFCellOpt

func (*PDFCellOpt) Height

func (opt *PDFCellOpt) Height(v float64) *PDFCellOpt

func (*PDFCellOpt) Italic

func (opt *PDFCellOpt) Italic() *PDFCellOpt
func (opt *PDFCellOpt) Link(v int) *PDFCellOpt

func (*PDFCellOpt) LinkStr

func (opt *PDFCellOpt) LinkStr(v string) *PDFCellOpt

func (*PDFCellOpt) LnAfter

func (opt *PDFCellOpt) LnAfter(v float64) *PDFCellOpt

func (*PDFCellOpt) LnPos

func (opt *PDFCellOpt) LnPos(v PDFTextBreak) *PDFCellOpt

func (*PDFCellOpt) TextColor added in v0.0.460

func (opt *PDFCellOpt) TextColor(cr, cg, cb int) *PDFCellOpt

func (*PDFCellOpt) TextColorHex added in v0.0.460

func (opt *PDFCellOpt) TextColorHex(c uint32) *PDFCellOpt

func (*PDFCellOpt) Width

func (opt *PDFCellOpt) Width(v float64) *PDFCellOpt

func (*PDFCellOpt) X

func (opt *PDFCellOpt) X(v float64) *PDFCellOpt

type PDFColor

type PDFColor struct {
	R int
	G int
	B int
}

type PDFFontFamily

type PDFFontFamily string
const (
	FontCourier      PDFFontFamily = "courier"
	FontHelvetica    PDFFontFamily = "helvetica"
	FontTimes        PDFFontFamily = "times"
	FontZapfDingbats PDFFontFamily = "zapfdingbats"
	FontSymbol       PDFFontFamily = "symbol"
)

type PDFFontStyle

type PDFFontStyle string
const (
	Normal     PDFFontStyle = ""
	Bold       PDFFontStyle = "B"
	Italic     PDFFontStyle = "I"
	BoldItalic PDFFontStyle = "IB"
)

type PDFImageOpt

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

func NewPDFImageOpt

func NewPDFImageOpt() *PDFImageOpt

func (*PDFImageOpt) AllowNegativePosition

func (opt *PDFImageOpt) AllowNegativePosition(v bool) *PDFImageOpt

func (*PDFImageOpt) Compression added in v0.0.451

func (opt *PDFImageOpt) Compression(v imageext.ImageCompresson) *PDFImageOpt

func (*PDFImageOpt) Crop added in v0.0.451

func (opt *PDFImageOpt) Crop(cropX float64, cropY float64, cropWidth float64, cropHeight float64) *PDFImageOpt

func (*PDFImageOpt) FillColor added in v0.0.451

func (opt *PDFImageOpt) FillColor(v color.Color) *PDFImageOpt

func (*PDFImageOpt) Flow

func (opt *PDFImageOpt) Flow(v bool) *PDFImageOpt

func (*PDFImageOpt) Height

func (opt *PDFImageOpt) Height(v float64) *PDFImageOpt

func (*PDFImageOpt) ImageFit added in v0.0.451

func (opt *PDFImageOpt) ImageFit(v imageext.ImageFit) *PDFImageOpt

func (*PDFImageOpt) ImageType

func (opt *PDFImageOpt) ImageType(v string) *PDFImageOpt
func (opt *PDFImageOpt) Link(v int) *PDFImageOpt

func (*PDFImageOpt) LinkStr

func (opt *PDFImageOpt) LinkStr(v string) *PDFImageOpt

func (*PDFImageOpt) ReEncodePixelPerMM added in v0.0.451

func (opt *PDFImageOpt) ReEncodePixelPerMM(v float64) *PDFImageOpt

func (*PDFImageOpt) ReadDpi

func (opt *PDFImageOpt) ReadDpi(v bool) *PDFImageOpt

func (*PDFImageOpt) Width

func (opt *PDFImageOpt) Width(v float64) *PDFImageOpt

func (*PDFImageOpt) X

func (opt *PDFImageOpt) X(v float64) *PDFImageOpt

func (*PDFImageOpt) Y

func (opt *PDFImageOpt) Y(v float64) *PDFImageOpt

type PDFImageRef

type PDFImageRef struct {
	Info  *gofpdf.ImageInfoType
	Name  string
	Bin   []byte
	Image *image.Image
	Mime  string
}

type PDFImageRegisterOpt

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

func NewPDFImageRegisterOpt

func NewPDFImageRegisterOpt() *PDFImageRegisterOpt

func (*PDFImageRegisterOpt) AllowNegativePosition

func (opt *PDFImageRegisterOpt) AllowNegativePosition(v bool) *PDFImageRegisterOpt

func (*PDFImageRegisterOpt) ImageType

func (opt *PDFImageRegisterOpt) ImageType(v string) *PDFImageRegisterOpt

func (*PDFImageRegisterOpt) Name

func (*PDFImageRegisterOpt) ReadDpi

func (opt *PDFImageRegisterOpt) ReadDpi(v bool) *PDFImageRegisterOpt

type PDFMargins

type PDFMargins struct {
	Left  float64
	Top   float64
	Right float64
}

type PDFMultiCellOpt

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

func NewPDFMultiCellOpt

func NewPDFMultiCellOpt() *PDFMultiCellOpt

func (*PDFMultiCellOpt) Align

func (*PDFMultiCellOpt) Bold

func (opt *PDFMultiCellOpt) Bold() *PDFMultiCellOpt

func (*PDFMultiCellOpt) Border

func (opt *PDFMultiCellOpt) Border(v PDFBorder) *PDFMultiCellOpt

func (*PDFMultiCellOpt) BorderColor added in v0.0.460

func (opt *PDFMultiCellOpt) BorderColor(cr, cg, cb int) *PDFMultiCellOpt

func (*PDFMultiCellOpt) BorderColorHex added in v0.0.460

func (opt *PDFMultiCellOpt) BorderColorHex(c uint32) *PDFMultiCellOpt

func (*PDFMultiCellOpt) FillBackground

func (opt *PDFMultiCellOpt) FillBackground(v bool) *PDFMultiCellOpt

func (*PDFMultiCellOpt) FillColor added in v0.0.460

func (opt *PDFMultiCellOpt) FillColor(cr, cg, cb int) *PDFMultiCellOpt

func (*PDFMultiCellOpt) FillColorHex added in v0.0.460

func (opt *PDFMultiCellOpt) FillColorHex(c uint32) *PDFMultiCellOpt

func (*PDFMultiCellOpt) Font

func (opt *PDFMultiCellOpt) Font(fontName PDFFontFamily, fontStyle PDFFontStyle, fontSize float64) *PDFMultiCellOpt

func (*PDFMultiCellOpt) FontName

func (opt *PDFMultiCellOpt) FontName(v PDFFontFamily) *PDFMultiCellOpt

func (*PDFMultiCellOpt) FontSize

func (opt *PDFMultiCellOpt) FontSize(v float64) *PDFMultiCellOpt

func (*PDFMultiCellOpt) FontStyle

func (opt *PDFMultiCellOpt) FontStyle(v PDFFontStyle) *PDFMultiCellOpt

func (*PDFMultiCellOpt) Height

func (opt *PDFMultiCellOpt) Height(v float64) *PDFMultiCellOpt

func (*PDFMultiCellOpt) Italic

func (opt *PDFMultiCellOpt) Italic() *PDFMultiCellOpt

func (*PDFMultiCellOpt) LnAfter

func (opt *PDFMultiCellOpt) LnAfter(v float64) *PDFMultiCellOpt

func (*PDFMultiCellOpt) TextColor added in v0.0.460

func (opt *PDFMultiCellOpt) TextColor(cr, cg, cb int) *PDFMultiCellOpt

func (*PDFMultiCellOpt) TextColorHex added in v0.0.460

func (opt *PDFMultiCellOpt) TextColorHex(c uint32) *PDFMultiCellOpt

func (*PDFMultiCellOpt) Width

func (opt *PDFMultiCellOpt) Width(v float64) *PDFMultiCellOpt

func (*PDFMultiCellOpt) X

type PDFOrientation

type PDFOrientation string
const (
	Portrait  PDFOrientation = "P"
	Landscape PDFOrientation = "L"
)

type PDFRectOpt

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

func NewPDFRectOpt

func NewPDFRectOpt() *PDFRectOpt

func (*PDFRectOpt) DrawColor

func (opt *PDFRectOpt) DrawColor(cr, cg, cb int) *PDFRectOpt

func (*PDFRectOpt) DrawColorHex

func (opt *PDFRectOpt) DrawColorHex(c uint32) *PDFRectOpt

func (*PDFRectOpt) FillColor

func (opt *PDFRectOpt) FillColor(cr, cg, cb int) *PDFRectOpt

func (*PDFRectOpt) FillColorHex

func (opt *PDFRectOpt) FillColorHex(c uint32) *PDFRectOpt

func (*PDFRectOpt) LineWidth

func (opt *PDFRectOpt) LineWidth(v float64) *PDFRectOpt

func (*PDFRectOpt) RadiusBL

func (opt *PDFRectOpt) RadiusBL(radius float64) *PDFRectOpt

func (*PDFRectOpt) RadiusBR

func (opt *PDFRectOpt) RadiusBR(radius float64) *PDFRectOpt

func (*PDFRectOpt) RadiusTL

func (opt *PDFRectOpt) RadiusTL(radius float64) *PDFRectOpt

func (*PDFRectOpt) RadiusTR

func (opt *PDFRectOpt) RadiusTR(radius float64) *PDFRectOpt

func (*PDFRectOpt) Rounded

func (opt *PDFRectOpt) Rounded(radius float64) *PDFRectOpt

func (*PDFRectOpt) X

func (opt *PDFRectOpt) X(v float64) *PDFRectOpt

func (*PDFRectOpt) Y

func (opt *PDFRectOpt) Y(v float64) *PDFRectOpt

type PDFRectStyle

type PDFRectStyle string
const (
	RectFill        PDFRectStyle = "F"
	RectOutline     PDFRectStyle = "D"
	RectFillOutline PDFRectStyle = "FD"
)

type PDFSize

type PDFSize string
const (
	SizeA3      PDFSize = "A3"
	SizeA4      PDFSize = "A4"
	SizeA5      PDFSize = "A4"
	SizeLetter  PDFSize = "Letter"
	SizeLegal   PDFSize = "Legal"
	SizeTabloid PDFSize = "Tabloid"
)

type PDFTextAlign

type PDFTextAlign string
const (
	AlignLeft       PDFTextAlign = "L"
	AlignHorzCenter PDFTextAlign = "C"
	AlignRight      PDFTextAlign = "R"
)

type PDFTextBreak

type PDFTextBreak int
const (
	BreakToRight    PDFTextBreak = 0
	BreakToNextLine PDFTextBreak = 1
	BreakToBelow    PDFTextBreak = 2
)

type WPDFBuilder

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

func NewPDFBuilder

func NewPDFBuilder(orientation PDFOrientation, size PDFSize, unicode bool) *WPDFBuilder

func (*WPDFBuilder) AddPage

func (b *WPDFBuilder) AddPage()

func (*WPDFBuilder) Build

func (b *WPDFBuilder) Build() ([]byte, error)

func (*WPDFBuilder) Cell

func (b *WPDFBuilder) Cell(txt string, opts ...*PDFCellOpt)

func (*WPDFBuilder) FPDF added in v0.0.453

func (b *WPDFBuilder) FPDF() *gofpdf.Fpdf

func (*WPDFBuilder) GetDrawColor

func (b *WPDFBuilder) GetDrawColor() (cr, cg, cb int)

func (*WPDFBuilder) GetFillColor

func (b *WPDFBuilder) GetFillColor() (cr, cg, cb int)

func (*WPDFBuilder) GetLineWidth

func (b *WPDFBuilder) GetLineWidth() float64

func (*WPDFBuilder) GetMarginBottom

func (b *WPDFBuilder) GetMarginBottom() float64

func (*WPDFBuilder) GetMarginLeft

func (b *WPDFBuilder) GetMarginLeft() float64

func (*WPDFBuilder) GetMarginRight

func (b *WPDFBuilder) GetMarginRight() float64

func (*WPDFBuilder) GetMarginTop

func (b *WPDFBuilder) GetMarginTop() float64

func (*WPDFBuilder) GetMargins

func (b *WPDFBuilder) GetMargins() (left, top, right, bottom float64)

func (*WPDFBuilder) GetPageHeight

func (b *WPDFBuilder) GetPageHeight() float64

func (*WPDFBuilder) GetPageSize

func (b *WPDFBuilder) GetPageSize() (width, height float64)

func (*WPDFBuilder) GetPageWidth

func (b *WPDFBuilder) GetPageWidth() float64

func (*WPDFBuilder) GetStringWidth

func (b *WPDFBuilder) GetStringWidth(str string) float64

func (*WPDFBuilder) GetTextColor

func (b *WPDFBuilder) GetTextColor() (cr, cg, cb int)

func (*WPDFBuilder) GetWorkAreaWidth

func (b *WPDFBuilder) GetWorkAreaWidth() float64

func (*WPDFBuilder) GetX

func (b *WPDFBuilder) GetX() float64

func (*WPDFBuilder) GetXY

func (b *WPDFBuilder) GetXY() (x float64, y float64)

func (*WPDFBuilder) GetY

func (b *WPDFBuilder) GetY() float64

func (*WPDFBuilder) Image

func (b *WPDFBuilder) Image(img *PDFImageRef, opts ...*PDFImageOpt)

func (*WPDFBuilder) IncX added in v0.0.461

func (b *WPDFBuilder) IncX(dx float64)

func (*WPDFBuilder) Ln

func (b *WPDFBuilder) Ln(h float64)

func (*WPDFBuilder) MultiCell

func (b *WPDFBuilder) MultiCell(txt string, opts ...*PDFMultiCellOpt)

func (*WPDFBuilder) Rect

func (b *WPDFBuilder) Rect(w float64, h float64, styleStr PDFRectStyle, opts ...*PDFRectOpt)

func (*WPDFBuilder) RegisterImage

func (b *WPDFBuilder) RegisterImage(bin []byte, opts ...*PDFImageRegisterOpt) *PDFImageRef

func (*WPDFBuilder) SetCellSpacing added in v0.0.454

func (b *WPDFBuilder) SetCellSpacing(h float64)

func (*WPDFBuilder) SetDrawColor

func (b *WPDFBuilder) SetDrawColor(cr, cg, cb int)

func (*WPDFBuilder) SetFillColor

func (b *WPDFBuilder) SetFillColor(cr, cg, cb int)

func (*WPDFBuilder) SetFont

func (b *WPDFBuilder) SetFont(fontName PDFFontFamily, fontStyle PDFFontStyle, fontSize float64)

func (*WPDFBuilder) SetLineWidth

func (b *WPDFBuilder) SetLineWidth(w float64)

func (*WPDFBuilder) SetMargins

func (b *WPDFBuilder) SetMargins(v PDFMargins)

func (*WPDFBuilder) SetTextColor

func (b *WPDFBuilder) SetTextColor(cr, cg, cb int)

func (*WPDFBuilder) SetX

func (b *WPDFBuilder) SetX(x float64)

func (*WPDFBuilder) SetXY

func (b *WPDFBuilder) SetXY(x float64, y float64)

func (*WPDFBuilder) SetY

func (b *WPDFBuilder) SetY(y float64)

Jump to

Keyboard shortcuts

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