Versions in this module Expand all Collapse all v0 v0.0.1 May 8, 2023 Changes in this version + const AlignBaseline + const AlignBottom + const AlignCenter + const AlignLeft + const AlignMiddle + const AlignRight + const AlignTop + const BorderBottom + const BorderFull + const BorderLeft + const BorderNone + const BorderRight + const BorderTop + const CnProtectAnnotForms + const CnProtectCopy + const CnProtectModify + const CnProtectPrint + const FontFlagAllCap + const FontFlagFixedPitch + const FontFlagItalic + const FontFlagNonsymbolic + const FontFlagScript + const FontFlagSerif + const FontFlagSymbolic + const ForceBold + const LineBreakBelow + const LineBreakNone + const LineBreakNormal + const OrientationLandscape + const OrientationPortrait + const PageSizeA3 + const PageSizeA4 + const PageSizeA5 + const PageSizeLegal + const PageSizeLetter + const SmallCap + const UnitCentimeter + const UnitInch + const UnitMillimeter + const UnitPoint + func MakeFont(fontFileStr, encodingFileStr, dstDirStr string, msgWriter io.Writer, ...) error + func SetDefaultCatalogSort(flag bool) + func SetDefaultCompression(compress bool) + func SetDefaultCreationDate(tm time.Time) + func SetDefaultModificationDate(tm time.Time) + func TickmarkPrecision(div float64) int + func Tickmarks(min, max float64) (list []float64, precision int) + func UTF8CutFont(inBuf []byte, cutset string) (outBuf []byte) + func UnicodeTranslator(r io.Reader) (f func(string) string, err error) + func UnicodeTranslatorFromFile(fileStr string) (f func(string) string, err error) + type Attachment struct + Content []byte + Description string + Filename string + type FontDescType struct + Ascent int + CapHeight int + Descent int + Flags int + FontBBox fontBoxType + ItalicAngle int + MissingWidth int + StemV int + type FpdfTpl struct + func (t *FpdfTpl) Bytes() []byte + func (t *FpdfTpl) FromPage(page int) (Template, error) + func (t *FpdfTpl) FromPages() []Template + func (t *FpdfTpl) GobDecode(buf []byte) error + func (t *FpdfTpl) GobEncode() ([]byte, error) + func (t *FpdfTpl) ID() string + func (t *FpdfTpl) Images() map[string]*ImageInfoType + func (t *FpdfTpl) NumPages() int + func (t *FpdfTpl) Serialize() ([]byte, error) + func (t *FpdfTpl) Size() (corner Point, size Size) + func (t *FpdfTpl) Templates() []Template + type GridType struct + ClrMain RGBAType + ClrSub RGBAType + ClrText RGBAType + TextSize float64 + WdMain float64 + WdSub float64 + XDiv int + XLabelIn bool + XLabelRotate bool + XTickStr TickFormatFncType + YDiv int + YLabelIn bool + YTickStr TickFormatFncType + func NewGrid(x, y, w, h float64) (grid GridType) + func (g *GridType) TickmarksContainX(min, max float64) + func (g *GridType) TickmarksContainY(min, max float64) + func (g *GridType) TickmarksExtentX(min, div float64, count int) + func (g *GridType) TickmarksExtentY(min, div float64, count int) + func (g GridType) Grid(pdf *Pdf) + func (g GridType) Ht(dataHt float64) float64 + func (g GridType) HtAbs(dataHt float64) float64 + func (g GridType) Plot(pdf *Pdf, xMin, xMax float64, count int, fnc func(x float64) (y float64)) + func (g GridType) Pos(xRel, yRel float64) (x, y float64) + func (g GridType) Wd(dataWd float64) float64 + func (g GridType) WdAbs(dataWd float64) float64 + func (g GridType) X(dataX float64) float64 + func (g GridType) XRange() (min, max float64) + func (g GridType) XY(dataX, dataY float64) (x, y float64) + func (g GridType) Y(dataY float64) float64 + func (g GridType) YRange() (min, max float64) + type HTMLBasicSegmentType struct + Attr map[string]string + Cat byte + Str string + func HTMLBasicTokenize(htmlStr string) (list []HTMLBasicSegmentType) + type HTMLBasicType struct + Link struct{ ... } + func (html *HTMLBasicType) Write(lineHt float64, htmlStr string) + type ImageInfoType struct + func (info *ImageInfoType) Extent() (wd, ht float64) + func (info *ImageInfoType) GobDecode(buf []byte) (err error) + func (info *ImageInfoType) GobEncode() (buf []byte, err error) + func (info *ImageInfoType) Height() float64 + func (info *ImageInfoType) SetDpi(dpi float64) + func (info *ImageInfoType) Width() float64 + type ImageOptions struct + AllowNegativePosition bool + ImageType string + ReadDpi bool + type InitType struct + FontDirStr string + OrientationStr string + Size Size + SizeStr string + UnitStr string + type PageBox struct + type Pdf struct + func New(orientationStr, unitStr, sizeStr, fontDirStr string) (f *Pdf) + func NewCustom(init *InitType) (f *Pdf) + func (f *Pdf) AddAttachmentAnnotation(a *Attachment, x, y, w, h float64) + func (f *Pdf) AddFont(familyStr, styleStr, fileStr string) + func (f *Pdf) AddFontFromBytes(familyStr, styleStr string, jsonFileBytes, zFileBytes []byte) + func (f *Pdf) AddFontFromReader(familyStr, styleStr string, r io.Reader) + func (f *Pdf) AddLayer(name string, visible bool) (layerID int) + func (f *Pdf) AddLink() int + func (f *Pdf) AddPage() + func (f *Pdf) AddPageFormat(orientationStr string, size Size) + func (f *Pdf) AddSpotColor(nameStr string, c, m, y, k byte) + func (f *Pdf) AddUTF8Font(familyStr, styleStr, fileStr string) + func (f *Pdf) AddUTF8FontFromBytes(familyStr, styleStr string, utf8Bytes []byte) + func (f *Pdf) AliasNbPages(aliasStr string) + func (f *Pdf) Arc(x, y, rx, ry, degRotate, degStart, degEnd float64, styleStr string) + func (f *Pdf) ArcTo(x, y, rx, ry, degRotate, degStart, degEnd float64) + func (f *Pdf) BeginLayer(id int) + func (f *Pdf) Beziergon(points []Point, styleStr string) + func (f *Pdf) Bookmark(txtStr string, level int, y float64) + func (f *Pdf) Cell(w, h float64, txtStr string) + func (f *Pdf) CellFormat(w, h float64, txtStr, borderStr string, ln int, alignStr string, fill bool, ...) + func (f *Pdf) Cellf(w, h float64, fmtStr string, args ...interface{}) + func (f *Pdf) Circle(x, y, r float64, styleStr string) + func (f *Pdf) ClearError() + func (f *Pdf) ClipCircle(x, y, r float64, outline bool) + func (f *Pdf) ClipEllipse(x, y, rx, ry float64, outline bool) + func (f *Pdf) ClipEnd() + func (f *Pdf) ClipPolygon(points []Point, outline bool) + func (f *Pdf) ClipRect(x, y, w, h float64, outline bool) + func (f *Pdf) ClipRoundedRect(x, y, w, h, r float64, outline bool) + func (f *Pdf) ClipRoundedRectExt(x, y, w, h, rTL, rTR, rBR, rBL float64, outline bool) + func (f *Pdf) ClipText(x, y float64, txtStr string, outline bool) + func (f *Pdf) Close() + func (f *Pdf) ClosePath() + func (f *Pdf) CreateTemplate(fn func(*Tpl)) Template + func (f *Pdf) CreateTemplateCustom(corner Point, size Size, fn func(*Tpl)) Template + func (f *Pdf) Curve(x0, y0, cx, cy, x1, y1 float64, styleStr string) + func (f *Pdf) CurveBezierCubic(x0, y0, cx0, cy0, cx1, cy1, x1, y1 float64, styleStr string) + func (f *Pdf) CurveBezierCubicTo(cx0, cy0, cx1, cy1, x, y float64) + func (f *Pdf) CurveCubic(x0, y0, cx0, cy0, x1, y1, cx1, cy1 float64, styleStr string) + func (f *Pdf) CurveTo(cx, cy, x, y float64) + func (f *Pdf) DrawPath(styleStr string) + func (f *Pdf) Ellipse(x, y, rx, ry, degRotate float64, styleStr string) + func (f *Pdf) EndLayer() + func (f *Pdf) Err() bool + func (f *Pdf) Error() error + func (f *Pdf) GetAlpha() (alpha float64, blendModeStr string) + func (f *Pdf) GetAutoPageBreak() (auto bool, margin float64) + func (f *Pdf) GetCellMargin() float64 + func (f *Pdf) GetConversionRatio() float64 + func (f *Pdf) GetDrawColor() (int, int, int) + func (f *Pdf) GetDrawSpotColor() (name string, c, m, y, k byte) + func (f *Pdf) GetFillColor() (int, int, int) + func (f *Pdf) GetFillSpotColor() (name string, c, m, y, k byte) + func (f *Pdf) GetFontDesc(familyStr, styleStr string) FontDescType + func (f *Pdf) GetFontSize() (ptSize, unitSize float64) + func (f *Pdf) GetImageInfo(imageStr string) (info *ImageInfoType) + func (f *Pdf) GetLineWidth() float64 + func (f *Pdf) GetMargins() (left, top, right, bottom float64) + func (f *Pdf) GetPageSize() (width, height float64) + func (f *Pdf) GetPageSizeStr(sizeStr string) (size Size) + func (f *Pdf) GetStringSymbolWidth(s string) int + func (f *Pdf) GetStringWidth(s string) float64 + func (f *Pdf) GetTextColor() (int, int, int) + func (f *Pdf) GetTextSpotColor() (name string, c, m, y, k byte) + func (f *Pdf) GetX() float64 + func (f *Pdf) GetXY() (float64, float64) + func (f *Pdf) GetY() float64 + func (f *Pdf) HTMLBasicNew() (html HTMLBasicType) + func (f *Pdf) Image(imageNameStr string, x, y, w, h float64, flow bool, tp string, link int, ...) + func (f *Pdf) ImageOptions(imageNameStr string, x, y, w, h float64, flow bool, options ImageOptions, ...) + func (f *Pdf) ImageTypeFromMime(mimeStr string) string + func (f *Pdf) ImportObjPos(objPos map[string]map[int]string) + func (f *Pdf) ImportObjects(objs map[string][]byte) + func (f *Pdf) ImportTemplates(tpls map[string]string) + func (f *Pdf) LTR() + func (f *Pdf) Line(x1, y1, x2, y2 float64) + func (f *Pdf) LineTo(x, y float64) + func (f *Pdf) LinearGradient(x, y, w, h float64, r1, g1, b1, r2, g2, b2 int, x1, y1, x2, y2 float64) + func (f *Pdf) Link(x, y, w, h float64, link int) + func (f *Pdf) LinkString(x, y, w, h float64, linkStr string) + func (f *Pdf) Ln(h float64) + func (f *Pdf) MoveTo(x, y float64) + func (f *Pdf) MultiCell(w, h float64, txtStr, borderStr, alignStr string, fill bool) + func (f *Pdf) Ok() bool + func (f *Pdf) OpenLayerPane() + func (f *Pdf) Output(w io.Writer) error + func (f *Pdf) OutputAndClose(w io.WriteCloser) error + func (f *Pdf) OutputFileAndClose(fileStr string) error + func (f *Pdf) PageCount() int + func (f *Pdf) PageNo() int + func (f *Pdf) PageSize(pageNum int) (wd, ht float64, unitStr string) + func (f *Pdf) PointConvert(pt float64) (u float64) + func (f *Pdf) PointToUnitConvert(pt float64) (u float64) + func (f *Pdf) Polygon(points []Point, styleStr string) + func (f *Pdf) RTL() + func (f *Pdf) RadialGradient(x, y, w, h float64, r1, g1, b1, r2, g2, b2 int, x1, y1, x2, y2, r float64) + func (f *Pdf) RawWriteBuf(r io.Reader) + func (f *Pdf) RawWriteStr(str string) + func (f *Pdf) Rect(x, y, w, h float64, styleStr string) + func (f *Pdf) RegisterAlias(alias, replacement string) + func (f *Pdf) RegisterImage(fileStr, tp string) (info *ImageInfoType) + func (f *Pdf) RegisterImageOptions(fileStr string, options ImageOptions) (info *ImageInfoType) + func (f *Pdf) RegisterImageOptionsReader(imgName string, options ImageOptions, r io.Reader) (info *ImageInfoType) + func (f *Pdf) RegisterImageReader(imgName, tp string, r io.Reader) (info *ImageInfoType) + func (f *Pdf) RoundedRect(x, y, w, h, r float64, corners string, stylestr string) + func (f *Pdf) RoundedRectExt(x, y, w, h, rTL, rTR, rBR, rBL float64, stylestr string) + func (f *Pdf) SVGBasicWrite(sb *SVGBasicType, scale float64) + func (f *Pdf) SetAcceptPageBreakFunc(fnc func() bool) + func (f *Pdf) SetAlpha(alpha float64, blendModeStr string) + func (f *Pdf) SetAttachments(as []Attachment) + func (f *Pdf) SetAuthor(authorStr string, isUTF8 bool) + func (f *Pdf) SetAutoPageBreak(auto bool, margin float64) + func (f *Pdf) SetCatalogSort(flag bool) + func (f *Pdf) SetCellMargin(margin float64) + func (f *Pdf) SetCompression(compress bool) + func (f *Pdf) SetCreationDate(tm time.Time) + func (f *Pdf) SetCreator(creatorStr string, isUTF8 bool) + func (f *Pdf) SetDashPattern(dashArray []float64, dashPhase float64) + func (f *Pdf) SetDisplayMode(zoomStr, layoutStr string) + func (f *Pdf) SetDrawColor(r, g, b int) + func (f *Pdf) SetDrawSpotColor(nameStr string, tint byte) + func (f *Pdf) SetError(err error) + func (f *Pdf) SetErrorf(fmtStr string, args ...interface{}) + func (f *Pdf) SetFillColor(r, g, b int) + func (f *Pdf) SetFillSpotColor(nameStr string, tint byte) + func (f *Pdf) SetFont(familyStr, styleStr string, size float64) + func (f *Pdf) SetFontLocation(fontDirStr string) + func (f *Pdf) SetFontSize(size float64) + func (f *Pdf) SetFontStyle(styleStr string) + func (f *Pdf) SetFontUnitSize(size float64) + func (f *Pdf) SetFooterFunc(fnc func()) + func (f *Pdf) SetFooterFuncLpi(fnc func(lastPage bool)) + func (f *Pdf) SetHeaderFunc(fnc func()) + func (f *Pdf) SetHeaderFuncMode(fnc func(), homeMode bool) + func (f *Pdf) SetHomeXY() + func (f *Pdf) SetJavascript(script string) + func (f *Pdf) SetKeywords(keywordsStr string, isUTF8 bool) + func (f *Pdf) SetLeftMargin(margin float64) + func (f *Pdf) SetLineCapStyle(styleStr string) + func (f *Pdf) SetLineJoinStyle(styleStr string) + func (f *Pdf) SetLineWidth(width float64) + func (f *Pdf) SetLink(link int, y float64, page int) + func (f *Pdf) SetMargins(left, top, right float64) + func (f *Pdf) SetModificationDate(tm time.Time) + func (f *Pdf) SetPage(pageNum int) + func (f *Pdf) SetPageBox(t string, x, y, wd, ht float64) + func (f *Pdf) SetPageBoxRec(t string, pb PageBox) + func (f *Pdf) SetProducer(producerStr string, isUTF8 bool) + func (f *Pdf) SetProtection(actionFlag byte, userPassStr, ownerPassStr string) + func (f *Pdf) SetRightMargin(margin float64) + func (f *Pdf) SetSubject(subjectStr string, isUTF8 bool) + func (f *Pdf) SetTextColor(r, g, b int) + func (f *Pdf) SetTextRenderingMode(mode int) + func (f *Pdf) SetTextSpotColor(nameStr string, tint byte) + func (f *Pdf) SetTitle(titleStr string, isUTF8 bool) + func (f *Pdf) SetTopMargin(margin float64) + func (f *Pdf) SetUnderlineThickness(thickness float64) + func (f *Pdf) SetWordSpacing(space float64) + func (f *Pdf) SetX(x float64) + func (f *Pdf) SetXY(x, y float64) + func (f *Pdf) SetXmpMetadata(xmpStream []byte) + func (f *Pdf) SetY(y float64) + func (f *Pdf) SplitLines(txt []byte, w float64) [][]byte + func (f *Pdf) SplitText(txt string, w float64) (lines []string) + func (f *Pdf) String() string + func (f *Pdf) SubWrite(ht float64, str string, subFontSize, subOffset float64, link int, ...) + func (f *Pdf) Text(x, y float64, txtStr string) + func (f *Pdf) Transform(tm TransformMatrix) + func (f *Pdf) TransformBegin() + func (f *Pdf) TransformEnd() + func (f *Pdf) TransformMirrorHorizontal(x float64) + func (f *Pdf) TransformMirrorLine(angle, x, y float64) + func (f *Pdf) TransformMirrorPoint(x, y float64) + func (f *Pdf) TransformMirrorVertical(y float64) + func (f *Pdf) TransformRotate(angle, x, y float64) + func (f *Pdf) TransformScale(scaleWd, scaleHt, x, y float64) + func (f *Pdf) TransformScaleX(scaleWd, x, y float64) + func (f *Pdf) TransformScaleXY(s, x, y float64) + func (f *Pdf) TransformScaleY(scaleHt, x, y float64) + func (f *Pdf) TransformSkew(angleX, angleY, x, y float64) + func (f *Pdf) TransformSkewX(angleX, x, y float64) + func (f *Pdf) TransformSkewY(angleY, x, y float64) + func (f *Pdf) TransformTranslate(tx, ty float64) + func (f *Pdf) TransformTranslateX(tx float64) + func (f *Pdf) TransformTranslateY(ty float64) + func (f *Pdf) UnicodeTranslatorFromDescriptor(cpStr string) (rep func(string) string) + func (f *Pdf) UnitToPointConvert(u float64) (pt float64) + func (f *Pdf) UseImportedTemplate(tplName string, scaleX float64, scaleY float64, tX float64, tY float64) + func (f *Pdf) UseTemplate(t Template) + func (f *Pdf) UseTemplateScaled(t Template, corner Point, size Size) + func (f *Pdf) Write(h float64, txtStr string) + func (f *Pdf) WriteAligned(width, lineHeight float64, textStr, alignStr string) + func (f *Pdf) WriteLinkID(h float64, displayStr string, linkID int) + func (f *Pdf) WriteLinkString(h float64, displayStr, targetStr string) + func (f *Pdf) Writef(h float64, fmtStr string, args ...interface{}) + type Point struct + X float64 + Y float64 + func NewPoint(x, y float64) *Point + func (p *Point) Coords() (float64, float64) + func (p *Point) Transform(dx, dy float64) Point + type RGBAType struct + Alpha float64 + B int + G int + R int + type RGBType struct + B int + G int + R int + type SVGBasicSegmentType struct + Arg [6]float64 + Cmd byte + type SVGBasicType struct + Ht float64 + Segments [][]SVGBasicSegmentType + Wd float64 + func SVGBasicFileParse(svgFileStr string) (sig SVGBasicType, err error) + func SVGBasicParse(buf []byte) (sig SVGBasicType, err error) + type Size struct + Ht float64 + Wd float64 + func (s *Size) Orientation() string + func (s *Size) ScaleBy(factor float64) Size + func (s *Size) ScaleToHeight(height float64) Size + func (s *Size) ScaleToWidth(width float64) Size + type StateType struct + func StateGet(pdf *Pdf) (st StateType) + func (st StateType) Put(pdf *Pdf) + type Template interface + Bytes func() []byte + FromPage func(int) (Template, error) + FromPages func() []Template + ID func() string + Images func() map[string]*ImageInfoType + NumPages func() int + Serialize func() ([]byte, error) + Size func() (Point, Size) + Templates func() []Template + func CreateTemplate(corner Point, size Size, unitStr, fontDirStr string, fn func(*Tpl)) Template + func CreateTpl(corner Point, size Size, orientationStr, unitStr, fontDirStr string, ...) Template + func DeserializeTemplate(b []byte) (Template, error) + type TextRenderMode uint8 + const Clip + const Fill + const FillClip + const FillStroke + const FillStrokeClip + const Invisible + const Stroke + const StrokeClip + type TickFormatFncType func(val float64, precision int) string + type Tpl struct + type TransformMatrix struct + A float64 + B float64 + C float64 + D float64 + E float64 + F float64 + type TtfType struct + Bold bool + CapHeight int16 + Chars map[uint16]uint16 + Embeddable bool + IsFixedPitch bool + ItalicAngle int16 + PostScriptName string + TypoAscender int16 + TypoDescender int16 + UnderlinePosition int16 + UnderlineThickness int16 + UnitsPerEm uint16 + Widths []uint16 + Xmax int16 + Xmin int16 + Ymax int16 + Ymin int16 + func TtfParse(fileStr string) (TtfRec TtfType, err error)