summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Montag <pmontag@iseeme.com>2018-10-31 19:40:24 -0500
committerPaul Montag <pmontag@iseeme.com>2018-10-31 19:40:24 -0500
commit0040f9be7d4f1220dc8ec4005aff693c9ea1a5aa (patch)
tree1b9f0d180bf94b87032528fa6c50306a656c7c03
parent6421d61dcdc4da19badab16dc2a8af331c4fbbeb (diff)
Added interface for Fpdf and Tpl
-rw-r--r--def.go172
1 files changed, 172 insertions, 0 deletions
diff --git a/def.go b/def.go
index d53e627..fdf439b 100644
--- a/def.go
+++ b/def.go
@@ -268,6 +268,178 @@ type FontLoader interface {
Open(name string) (io.Reader, error)
}
+type Pdf interface {
+ AddFont(familyStr, styleStr, fileStr string)
+ AddFontFromBytes(familyStr, styleStr string, jsonFileBytes, zFileBytes []byte)
+ AddFontFromReader(familyStr, styleStr string, r io.Reader)
+ AddLayer(name string, visible bool) (layerID int)
+ AddLink() int
+ AddPage()
+ AddPageFormat(orientationStr string, size SizeType)
+ AddSpotColor(nameStr string, c, m, y, k byte)
+ AliasNbPages(aliasStr string)
+ Arc(x, y, rx, ry, degRotate, degStart, degEnd float64, styleStr string)
+ ArcTo(x, y, rx, ry, degRotate, degStart, degEnd float64)
+ BeginLayer(id int)
+ Beziergon(points []PointType, styleStr string)
+ Bookmark(txtStr string, level int, y float64)
+ Cell(w, h float64, txtStr string)
+ CellFormat(w, h float64, txtStr, borderStr string, ln int, alignStr string, fill bool, link int, linkStr string)
+ Cellf(w, h float64, fmtStr string, args ...interface{})
+ Circle(x, y, r float64, styleStr string)
+ ClearError()
+ ClipCircle(x, y, r float64, outline bool)
+ ClipEllipse(x, y, rx, ry float64, outline bool)
+ ClipEnd()
+ ClipPolygon(points []PointType, outline bool)
+ ClipRect(x, y, w, h float64, outline bool)
+ ClipRoundedRect(x, y, w, h, r float64, outline bool)
+ ClipText(x, y float64, txtStr string, outline bool)
+ Close()
+ ClosePath()
+ CreateTemplate(fn func(*Tpl)) Template
+ CreateTemplateCustom(corner PointType, size SizeType, fn func(*Tpl)) Template
+ Curve(x0, y0, cx, cy, x1, y1 float64, styleStr string)
+ CurveBezierCubic(x0, y0, cx0, cy0, cx1, cy1, x1, y1 float64, styleStr string)
+ CurveBezierCubicTo(cx0, cy0, cx1, cy1, x, y float64)
+ CurveCubic(x0, y0, cx0, cy0, x1, y1, cx1, cy1 float64, styleStr string)
+ CurveTo(cx, cy, x, y float64)
+ DrawPath(styleStr string)
+ Ellipse(x, y, rx, ry, degRotate float64, styleStr string)
+ EndLayer()
+ Err() bool
+ Error() error
+ GetAlpha() (alpha float64, blendModeStr string)
+ GetAutoPageBreak() (auto bool, margin float64)
+ GetCellMargin() float64
+ GetConversionRatio() float64
+ GetDrawColor() (int, int, int)
+ GetDrawSpotColor() (name string, c, m, y, k byte)
+ GetFillColor() (int, int, int)
+ GetFillSpotColor() (name string, c, m, y, k byte)
+ GetFontDesc(familyStr, styleStr string) FontDescType
+ GetFontSize() (ptSize, unitSize float64)
+ GetImageInfo(imageStr string) (info *ImageInfoType)
+ GetLineWidth() float64
+ GetMargins() (left, top, right, bottom float64)
+ GetPageSize() (width, height float64)
+ GetPageSizeStr(sizeStr string) (size SizeType)
+ GetStringWidth(s string) float64
+ GetTextColor() (int, int, int)
+ GetTextSpotColor() (name string, c, m, y, k byte)
+ GetX() float64
+ GetXY() (float64, float64)
+ GetY() float64
+ HTMLBasicNew() (html HTMLBasicType)
+ Image(imageNameStr string, x, y, w, h float64, flow bool, tp string, link int, linkStr string)
+ ImageOptions(imageNameStr string, x, y, w, h float64, flow bool, options ImageOptions, link int, linkStr string)
+ ImageTypeFromMime(mimeStr string) (tp string)
+ Line(x1, y1, x2, y2 float64)
+ LineTo(x, y float64)
+ LinearGradient(x, y, w, h float64, r1, g1, b1, r2, g2, b2 int, x1, y1, x2, y2 float64)
+ Link(x, y, w, h float64, link int)
+ LinkString(x, y, w, h float64, linkStr string)
+ Ln(h float64)
+ MoveTo(x, y float64)
+ MultiCell(w, h float64, txtStr, borderStr, alignStr string, fill bool)
+ Ok() bool
+ OpenLayerPane()
+ Output(w io.Writer) error
+ OutputAndClose(w io.WriteCloser) error
+ OutputFileAndClose(fileStr string) error
+ PageNo() int
+ PageSize(pageNum int) (wd, ht float64, unitStr string)
+ PointConvert(pt float64) (u float64)
+ PointToUnitConvert(pt float64) (u float64)
+ Polygon(points []PointType, styleStr string)
+ RadialGradient(x, y, w, h float64, r1, g1, b1, r2, g2, b2 int, x1, y1, x2, y2, r float64)
+ RawWriteBuf(r io.Reader)
+ RawWriteStr(str string)
+ Rect(x, y, w, h float64, styleStr string)
+ RegisterAlias(alias, replacement string)
+ RegisterImage(fileStr, tp string) (info *ImageInfoType)
+ RegisterImageOptions(fileStr string, options ImageOptions) (info *ImageInfoType)
+ RegisterImageOptionsReader(imgName string, options ImageOptions, r io.Reader) (info *ImageInfoType)
+ RegisterImageReader(imgName, tp string, r io.Reader) (info *ImageInfoType)
+ SVGBasicWrite(sb *SVGBasicType, scale float64)
+ SetAcceptPageBreakFunc(fnc func() bool)
+ SetAlpha(alpha float64, blendModeStr string)
+ SetAuthor(authorStr string, isUTF8 bool)
+ SetAutoPageBreak(auto bool, margin float64)
+ SetCatalogSort(flag bool)
+ SetCellMargin(margin float64)
+ SetCompression(compress bool)
+ SetCreationDate(tm time.Time)
+ SetCreator(creatorStr string, isUTF8 bool)
+ SetDashPattern(dashArray []float64, dashPhase float64)
+ SetDisplayMode(zoomStr, layoutStr string)
+ SetDrawColor(r, g, b int)
+ SetDrawSpotColor(nameStr string, tint byte)
+ SetError(err error)
+ SetErrorf(fmtStr string, args ...interface{})
+ SetFillColor(r, g, b int)
+ SetFillSpotColor(nameStr string, tint byte)
+ SetFont(familyStr, styleStr string, size float64)
+ SetFontLoader(loader FontLoader)
+ SetFontLocation(fontDirStr string)
+ SetFontSize(size float64)
+ SetFontUnitSize(size float64)
+ SetFooterFunc(fnc func())
+ SetFooterFuncLpi(fnc func(lastPage bool))
+ SetHeaderFunc(fnc func())
+ SetHeaderFuncMode(fnc func(), homeMode bool)
+ SetHomeXY()
+ SetJavascript(script string)
+ SetKeywords(keywordsStr string, isUTF8 bool)
+ SetLeftMargin(margin float64)
+ SetLineCapStyle(styleStr string)
+ SetLineJoinStyle(styleStr string)
+ SetLineWidth(width float64)
+ SetLink(link int, y float64, page int)
+ SetMargins(left, top, right float64)
+ SetProtection(actionFlag byte, userPassStr, ownerPassStr string)
+ SetRightMargin(margin float64)
+ SetSubject(subjectStr string, isUTF8 bool)
+ SetTextColor(r, g, b int)
+ SetTextSpotColor(nameStr string, tint byte)
+ SetTitle(titleStr string, isUTF8 bool)
+ SetTopMargin(margin float64)
+ SetX(x float64)
+ SetXY(x, y float64)
+ SetXmpMetadata(xmpStream []byte)
+ SetY(y float64)
+ SplitLines(txt []byte, w float64) [][]byte
+ String() string
+ Text(x, y float64, txtStr string)
+ Transform(tm TransformMatrix)
+ TransformBegin()
+ TransformEnd()
+ TransformMirrorHorizontal(x float64)
+ TransformMirrorLine(angle, x, y float64)
+ TransformMirrorPoint(x, y float64)
+ TransformMirrorVertical(y float64)
+ TransformRotate(angle, x, y float64)
+ TransformScale(scaleWd, scaleHt, x, y float64)
+ TransformScaleX(scaleWd, x, y float64)
+ TransformScaleXY(s, x, y float64)
+ TransformScaleY(scaleHt, x, y float64)
+ TransformSkew(angleX, angleY, x, y float64)
+ TransformSkewX(angleX, x, y float64)
+ TransformSkewY(angleY, x, y float64)
+ TransformTranslate(tx, ty float64)
+ TransformTranslateX(tx float64)
+ TransformTranslateY(ty float64)
+ UnicodeTranslatorFromDescriptor(cpStr string) (rep func(string) string)
+ UnitToPointConvert(u float64) (pt float64)
+ UseTemplate(t Template)
+ UseTemplateScaled(t Template, corner PointType, size SizeType)
+ Write(h float64, txtStr string)
+ WriteAligned(width, lineHeight float64, textStr, alignStr string)
+ WriteLinkID(h float64, displayStr string, linkID int)
+ WriteLinkString(h float64, displayStr, targetStr string)
+ Writef(h float64, fmtStr string, args ...interface{})
+}
+
// Fpdf is the principal structure for creating a single PDF document
type Fpdf struct {
page int // current page number