Documentation
¶
Index ¶
- func Barcode(pdf barcodePdf, code string, x, y, w, h float64, flow bool)
- func BarcodeUnscalable(pdf barcodePdf, code string, x, y float64, w, h *float64, flow bool)
- func GetUnscaledBarcodeDimensions(pdf barcodePdf, code string) (w, h float64)
- func NewCode(pdf gofpdf.Pdf, math Math) *code
- func NewFont(pdf gofpdf.Pdf, size float64, family consts.Family, style consts.Style) *font
- func NewImage(pdf gofpdf.Pdf, math Math) *image
- func NewMath(pdf gofpdf.Pdf) *math
- func NewSignature(pdf gofpdf.Pdf, math Math, text Text) *signature
- func NewTableList(text Text, font Font) *tableList
- func NewText(pdf gofpdf.Pdf, math Math, font Font) *text
- func Register(bcode barcode.Barcode) string
- func RegisterAztec(pdf barcodePdf, code string, minECCPercent int, userSpecifiedLayers int) string
- func RegisterCodabar(pdf barcodePdf, code string) string
- func RegisterCode128(pdf barcodePdf, code string) string
- func RegisterCode39(pdf barcodePdf, code string, includeChecksum, fullASCIIMode bool) string
- func RegisterDataMatrix(pdf barcodePdf, code string) string
- func RegisterEAN(pdf barcodePdf, code string) string
- func RegisterPdf417(pdf barcodePdf, code string, columns int, securityLevel int) string
- func RegisterQR(pdf barcodePdf, code string, ecl qr.ErrorCorrectionLevel, mode qr.Encoding) string
- func RegisterTwoOfFive(pdf barcodePdf, code string, interleaved bool) string
- type Cell
- type Code
- type Font
- type Image
- type MarotoGridPart
- type Math
- type Signature
- type TableList
- type Text
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Barcode ¶ added in v1.1.1
Barcode puts a registered barcode in the current page.
The size should be specified in the units used to create the PDF document. If width or height are left unspecfied, the barcode is not scaled in the unspecified dimensions.
Positioning with x, y and flow is inherited from Fpdf.Image().
func BarcodeUnscalable ¶ added in v1.1.1
BarcodeUnscalable puts a registered barcode in the current page.
Its arguments work in the same way as that of Barcode(). However, it allows for an unscaled barcode in the width and/or height dimensions. This can be useful if you want to prevent side effects of upscaling.
func GetUnscaledBarcodeDimensions ¶ added in v1.1.1
GetUnscaledBarcodeDimensions returns the width and height of the unscaled barcode associated with the given code.
func NewSignature ¶
NewSignature create a Signature
func NewTableList ¶
NewTableList create a TableList
func Register ¶ added in v1.1.1
Register registers a barcode but does not put it on the page. Use Barcode() with the same code to put the barcode on the PDF page.
func RegisterAztec ¶ added in v1.1.1
RegisterAztec registers a barcode of type Aztec to the PDF, but not to the page. Use Barcode() with the return value to put the barcode on the page. code is the string to be encoded. minECCPercent is the error correction percentage. 33 is the default. userSpecifiedLayers can be a value between -4 and 32 inclusive.
func RegisterCodabar ¶ added in v1.1.1
RegisterCodabar registers a barcode of type Codabar to the PDF, but not to the page. Use Barcode() with the return value to put the barcode on the page.
func RegisterCode128 ¶ added in v1.1.1
RegisterCode128 registers a barcode of type Code128 to the PDF, but not to the page. Use Barcode() with the return value to put the barcode on the page.
func RegisterCode39 ¶ added in v1.1.1
RegisterCode39 registers a barcode of type Code39 to the PDF, but not to the page. Use Barcode() with the return value to put the barcode on the page.
includeChecksum and fullASCIIMode are inherited from code39.Encode().
func RegisterDataMatrix ¶ added in v1.1.1
RegisterDataMatrix registers a barcode of type DataMatrix to the PDF, but not to the page. Use Barcode() with the return value to put the barcode on the page.
func RegisterEAN ¶ added in v1.1.1
RegisterEAN registers a barcode of type EAN to the PDF, but not to the page. It will automatically detect if the barcode is EAN8 or EAN13. Use Barcode() with the return value to put the barcode on the page.
func RegisterPdf417 ¶ added in v1.1.1
RegisterPdf417 registers a barcode of type Pdf417 to the PDF, but not to the page. code is the string to be encoded. columns specifies the number of barcode columns; this should be a value between 1 and 30 inclusive. securityLevel specifies an error correction level between zero and 8 inclusive. Barcodes for use with FedEx must set columns to 10 and securityLevel to 5. Use Barcode() with the return value to put the barcode on the page.
func RegisterQR ¶ added in v1.1.1
RegisterQR registers a barcode of type QR to the PDF, but not to the page. Use Barcode() with the return value to put the barcode on the page.
The ErrorCorrectionLevel and Encoding mode are inherited from qr.Encode().
func RegisterTwoOfFive ¶ added in v1.1.1
RegisterTwoOfFive registers a barcode of type TwoOfFive to the PDF, but not to the page. Use Barcode() with the return value to put the barcode on the page.
The interleaved bool is inherited from twooffive.Encode().
Types ¶
type Code ¶
type Code interface { AddQr(code string, cell Cell, prop props.Rect) AddBar(code string, cell Cell, prop props.Barcode) (err error) }
Code is the abstraction which deals of how to add QrCodes or Barcode in a PDF
type Font ¶
type Font interface { SetFamily(family consts.Family) SetStyle(style consts.Style) SetSize(size float64) SetFont(family consts.Family, style consts.Style, size float64) GetFamily() consts.Family GetStyle() consts.Style GetSize() float64 GetFont() (consts.Family, consts.Style, float64) GetScaleFactor() (scaleFactor float64) }
Font is the abstraction which deals of how to set font configurations
type Image ¶
type Image interface { AddFromFile(path string, cell Cell, prop props.Rect) (err error) AddFromBase64(stringBase64 string, cell Cell, prop props.Rect, extension consts.Extension) (err error) }
Image is the abstraction which deals of how to add images in a PDF
type MarotoGridPart ¶
type MarotoGridPart interface { // Grid System Row(height float64, closure func()) Col(width uint, closure func()) ColSpace(width uint) // Helpers SetBackgroundColor(color color.Color) GetCurrentOffset() float64 GetPageSize() (width float64, height float64) GetPageMargins() (left float64, top float64, right float64, bottom float64) // Outside Col/Row Components Line(spaceHeight float64) // Inside Col/Row Components Text(text string, prop ...props.Text) }
MarotoGridPart is the abstraction to deal with the gris system inside the table list
type Math ¶
type Math interface { GetRectCenterColProperties(imageWidth float64, imageHeight float64, colWidth float64, colHeight float64, xColOffset float64, percent float64) (x float64, y float64, w float64, h float64) GetRectNonCenterColProperties(imageWidth float64, imageHeight float64, colWidth float64, colHeight float64, xColOffset float64, prop props.Rect) (x float64, y float64, w float64, h float64) GetCenterCorrection(outerSize, innerSize float64) float64 }
Math is the abstraction which deals with useful calc
type Signature ¶
Signature is the abstraction which deals of how to add a signature space inside PDF