Documentation ¶
Index ¶
- Constants
- Variables
- func CheckSum(data []byte) uint
- func Chr(n int) byte
- func Coefficients(p0, p1, p2, p3 float64) (C1, C2, C3, C4 float64)
- func CreateEmbeddedFontSubsetName(name string) string
- func CurveLength(bc BezierCurve) float64
- func DebugSubType(b []byte)
- func DesignUnitsToPdf(val int, unitsPerEm uint) int
- func Distance(p0, p1 Point) float64
- func FontConvertHelper_Cw2Str(cw FontCw) string
- func GetConvertedStyle(fontStyle string) int
- func ImgReactagleToWH(imageRect image.Rectangle) (float64, float64)
- func PageBoundaryType(t int) string
- func PointsToUnits(t int, u float64) float64
- func PointsToUnitsVar(t int, u ...*float64)
- func ReadShortFromByte(data []byte, offset int) (int64, int)
- func ReadUShortFromByte(data []byte, offset int) (uint64, int)
- func StrHelperGetStringWidth(str string, fontSize int, ifont IFont) float64
- func ToByte(chr string) byte
- func UnitsToPoints(t int, u float64) float64
- func UnitsToPointsVar(t int, u ...*float64)
- func WriteBytes(w io.Writer, data []byte, offset int, count int) error
- func WriteTag(w io.Writer, tag string) error
- func WriteUInt16(w io.Writer, v uint) error
- func WriteUInt32(w io.Writer, v uint) error
- type BezierCurve
- func (bc BezierCurve) At(t float64) Point
- func (bc BezierCurve) Curve(p []Point) []Point
- func (bc BezierCurve) Dx(t float64) float64
- func (bc BezierCurve) Dy(t float64) float64
- func (bc BezierCurve) NormalDegrees(t float64) float64
- func (bc BezierCurve) SampleByArcLength(sample []float64) []float64
- func (bc BezierCurve) Tangent(t float64) Point
- type BezierPoint
- type BezierSpline
- type BezierSplineSample
- type Buff
- type CIDFontObj
- type CacheContent
- type CatalogObj
- type CellOption
- type ContentObj
- func (c *ContentObj) AppendStreamArcTo(x, y, rx, ry, degRotate, degStart, degEnd float64, styleStr string, path bool)
- func (c *ContentObj) AppendStreamClipBegin()
- func (c *ContentObj) AppendStreamClipEllipse(x, y, rx, ry float64, style string)
- func (c *ContentObj) AppendStreamClipEnd()
- func (c *ContentObj) AppendStreamClipPolygon(points []Point, style string)
- func (c *ContentObj) AppendStreamClipRect(x, y, w, h float64, style string)
- func (c *ContentObj) AppendStreamClipRoundedRect(x, y, w, h, r float64, style string)
- func (c *ContentObj) AppendStreamClipText(x, y float64, txtStr string, style int)
- func (c *ContentObj) AppendStreamClosePath()
- func (c *ContentObj) AppendStreamCurve(cx, cy, x, y float64)
- func (c *ContentObj) AppendStreamCurveBezierCubic(cx0, cy0, cx1, cy1, x, y float64)
- func (c *ContentObj) AppendStreamDrawPath(styleStr string)
- func (c *ContentObj) AppendStreamImage(id string, x float64, y float64, rect Rect)
- func (c *ContentObj) AppendStreamLine(x1 float64, y1 float64, x2 float64, y2 float64)
- func (c *ContentObj) AppendStreamLineTo(x, y float64)
- func (c *ContentObj) AppendStreamOval(x1 float64, y1 float64, x2 float64, y2 float64)
- func (c *ContentObj) AppendStreamPoint(x, y float64)
- func (c *ContentObj) AppendStreamRectangle(x float64, y float64, wdth float64, hght float64, style string)
- func (c *ContentObj) AppendStreamSetCMYKColorFill(cy uint8, m uint8, y uint8, k uint8)
- func (c *ContentObj) AppendStreamSetCMYKColorStroke(cy uint8, m uint8, y uint8, k uint8)
- func (c *ContentObj) AppendStreamSetCapStyle(t int)
- func (c *ContentObj) AppendStreamSetGrayFill(w float64)
- func (c *ContentObj) AppendStreamSetGrayStroke(w float64)
- func (c *ContentObj) AppendStreamSetJoinStyle(t int)
- func (c *ContentObj) AppendStreamSetLineType(t string)
- func (c *ContentObj) AppendStreamSetLineWidth(w float64)
- func (c *ContentObj) AppendStreamSetRGBColorFill(r uint8, g uint8, b uint8)
- func (c *ContentObj) AppendStreamSetRGBColorStroke(r uint8, g uint8, b uint8)
- func (c *ContentObj) AppendStreamSubsetFont(rectangle Rect, text string, cellOpt CellOption, textOpts TextOption) error
- func (c *ContentObj) AppendStreamText(text string) error
- func (c *ContentObj) AppendStreamTransform(matrix TransformMatrix)
- func (c *ContentObj) AppendStreamTransformBegin()
- func (c *ContentObj) AppendStreamTransformEnd()
- func (c *ContentObj) AppendStreamUseTemplate(id string, x, y, h, sx, sy float64)
- type Current
- type DeviceRGBObj
- type EmbedFontObj
- type EncodingObj
- type EncryptionObj
- type FontCw
- type FontDescItem
- type FontDescriptorObj
- type Fpdf
- func (gp *Fpdf) AddExternalLink(url string, x, y, w, h float64)
- func (gp *Fpdf) AddInternalLink(anchor string, x, y, w, h float64)
- func (gp *Fpdf) AddPage()
- func (gp *Fpdf) AddPageWithOption(opt PageOption)
- func (gp *Fpdf) AddTTFFont(family string, ttfpath string) error
- func (gp *Fpdf) AddTTFFontByReader(family string, rd io.Reader) error
- func (gp *Fpdf) AddTTFFontByReaderWithOption(family string, rd io.Reader, option TtfOption) error
- func (gp *Fpdf) AddTTFFontBySubsetFont(family string, subsetFont *SubsetFontObj) error
- func (gp *Fpdf) AddTTFFontWithOption(family string, ttfpath string, option TtfOption) error
- func (gp *Fpdf) Arc(x, y, rx, ry, degRotate, degStart, degEnd float64, styleStr string)
- func (gp *Fpdf) ArcTo(x, y, rx, ry, degRotate, degStart, degEnd float64)
- func (gp *Fpdf) Beziergon(pts Points, styleStr string) error
- func (gp *Fpdf) Beziertext(pts Points, startBracket, endBracket float64, text string, opt CellOption, ...) error
- func (gp *Fpdf) Cell(w, h float64, text string) error
- func (gp *Fpdf) CellWithOption(w, h float64, text string, opt CellOption, textOpts TextOption) error
- func (gp *Fpdf) Cellf(w, h float64, text string, args ...interface{}) error
- func (gp *Fpdf) Circle(x, y, r float64, styleStr string)
- func (gp *Fpdf) ClipCircle(x, y, r float64, outline bool)
- func (gp *Fpdf) ClipEllipse(x, y, rx, ry float64, outline bool)
- func (gp *Fpdf) ClipEnd()
- func (gp *Fpdf) ClipPolygon(points []Point, outline bool)
- func (gp *Fpdf) ClipRect(x, y, w, h float64, outline bool)
- func (gp *Fpdf) ClipRoundedRect(x, y, w, h, r float64, outline bool)
- func (gp *Fpdf) ClipText(x, y float64, txtStr string, outline bool)
- func (gp *Fpdf) Close() error
- func (gp *Fpdf) ClosePath()
- func (gp *Fpdf) CreateTemplate(fn TplFunc) (Template, error)
- func (gp *Fpdf) CreateTemplateCustom(corner Point, fn TplFunc, opts ...PdfOption) (Template, error)
- func (gp *Fpdf) Curve(x0, y0, cx, cy, x1, y1 float64, styleStr string)
- func (gp *Fpdf) CurveBezierCubic(x0, y0, cx0, cy0, cx1, cy1, x1, y1 float64, styleStr string)
- func (gp *Fpdf) CurveBezierCubicTo(cx0, cy0, cx1, cy1, x, y float64)
- func (gp *Fpdf) CurveCubic(x0, y0, cx0, cy0, x1, y1, cx1, cy1 float64, styleStr string)
- func (gp *Fpdf) CurveTo(cx, cy, x, y float64)
- func (gp *Fpdf) DrawPath(styleStr string)
- func (gp *Fpdf) DrawPrinterMarks()
- func (gp *Fpdf) Ellipse(x, y, rx, ry, degRotate float64, styleStr string)
- func (gp *Fpdf) GetBoundaryHeight(t int) float64
- func (gp *Fpdf) GetBoundaryPosition(t int) (p Point)
- func (gp *Fpdf) GetBoundarySize(t int) (rec Rect)
- func (gp *Fpdf) GetBoundaryWidth(t int) float64
- func (gp *Fpdf) GetBoundaryX(t int) float64
- func (gp *Fpdf) GetBoundaryY(t int) float64
- func (gp *Fpdf) GetBytesPdf() []byte
- func (gp *Fpdf) GetBytesPdfReturnErr() ([]byte, error)
- func (gp *Fpdf) GetInfo() *PdfInfo
- func (gp *Fpdf) GetPageBoundary(t int) *PageBoundary
- func (gp *Fpdf) Image(picPath string, x float64, y float64, rect Rect) error
- func (gp *Fpdf) ImageByHolder(img ImageHolder, x float64, y float64, rect Rect) error
- func (gp *Fpdf) ImageByObj(img *ImageObj, x float64, y float64, rect Rect) error
- func (gp *Fpdf) ImageByReader(r io.Reader, x float64, y float64, rect Rect) error
- func (gp *Fpdf) ImageByURL(url string, x float64, y float64, rect Rect) error
- func (gp *Fpdf) KernOverride(family string, fn FuncKernOverride) error
- func (gp *Fpdf) Line(x1 float64, y1 float64, x2 float64, y2 float64)
- func (gp *Fpdf) LineTo(x, y float64)
- func (gp *Fpdf) Ln(h float64)
- func (gp *Fpdf) MarginBottom() float64
- func (gp *Fpdf) MarginLeft() float64
- func (gp *Fpdf) MarginRight() float64
- func (gp *Fpdf) MarginTop() float64
- func (gp *Fpdf) Margins() (float64, float64, float64, float64)
- func (gp *Fpdf) MeasureTextWidth(text string, textOpt TextOption) (float64, error)
- func (gp *Fpdf) MoveTo(x, y float64)
- func (gp *Fpdf) MultiCell(w, h float64, txtStr string) error
- func (gp *Fpdf) MultiCellOpts(w, h float64, txtStr string, opts CellOption, textOpts TextOption) error
- func (gp *Fpdf) NewArtPageBoundary(x, y, w, h float64) *PageBoundary
- func (gp *Fpdf) NewBleedPageBoundary(x, y, w, h float64) *PageBoundary
- func (gp *Fpdf) NewCropPageBoundary(x, y, w, h float64) *PageBoundary
- func (gp *Fpdf) NewPageBoundary(t int, x, y, w, h float64) (*PageBoundary, error)
- func (gp *Fpdf) NewPageOption(w, h float64) *PageOption
- func (gp *Fpdf) NewPageSizeBoundary(w, h float64) *PageBoundary
- func (gp *Fpdf) NewTrimPageBoundary(x, y, w, h float64) *PageBoundary
- func (gp *Fpdf) Oval(x1 float64, y1 float64, x2 float64, y2 float64)
- func (gp *Fpdf) PointsToUnits(u float64) float64
- func (gp *Fpdf) PointsToUnitsVar(u ...*float64)
- func (gp *Fpdf) Read(p []byte) (int, error)
- func (gp *Fpdf) RectFromLowerLeft(x float64, y float64, wdth float64, hght float64)
- func (gp *Fpdf) RectFromLowerLeftWithStyle(x float64, y float64, wdth float64, hght float64, style string)
- func (gp *Fpdf) RectFromUpperLeft(x float64, y float64, wdth float64, hght float64)
- func (gp *Fpdf) RectFromUpperLeftWithStyle(x float64, y float64, wdth float64, hght float64, style string)
- func (gp *Fpdf) Rotate(angle, x, y float64)
- func (gp *Fpdf) RotateReset()
- func (gp *Fpdf) SetAnchor(name string)
- func (gp *Fpdf) SetArtBox(x, y, w, h float64)
- func (gp *Fpdf) SetAuthor(authorStr string)
- func (gp *Fpdf) SetBleedBox(x, y, w, h float64)
- func (gp *Fpdf) SetCMYKFillColor(c, m, y, k uint8)
- func (gp *Fpdf) SetCMYKStrokeColor(c, m, y, k uint8)
- func (gp *Fpdf) SetCompressLevel(level int)
- func (gp *Fpdf) SetCreator(creatorStr string)
- func (gp *Fpdf) SetCropBox(x, y, w, h float64)
- func (gp *Fpdf) SetFont(family string, style string, size float64) error
- func (gp *Fpdf) SetFontWithStyle(family string, style int, size float64) error
- func (gp *Fpdf) SetGrayFill(grayScale float64)
- func (gp *Fpdf) SetGrayStroke(grayScale float64)
- func (gp *Fpdf) SetInfo(info PdfInfo)
- func (gp *Fpdf) SetKeywords(keywordsStr string)
- func (gp *Fpdf) SetLineCapStyle(style int)
- func (gp *Fpdf) SetLineJoinStyle(style int)
- func (gp *Fpdf) SetLineType(linetype string)
- func (gp *Fpdf) SetLineWidth(width float64)
- func (gp *Fpdf) SetMarginBottom(margin float64)
- func (gp *Fpdf) SetMarginLeft(margin float64)
- func (gp *Fpdf) SetMarginRight(margin float64)
- func (gp *Fpdf) SetMarginTop(margin float64)
- func (gp *Fpdf) SetMargins(left, top, right, bottom float64)
- func (gp *Fpdf) SetNoCompression()
- func (gp *Fpdf) SetPageBoundary(pb *PageBoundary)
- func (gp *Fpdf) SetPageSize(w, h float64)
- func (gp *Fpdf) SetProducer(producerStr string)
- func (gp *Fpdf) SetRGBFillColor(r uint8, g uint8, b uint8)
- func (gp *Fpdf) SetRGBStrokeColor(r uint8, g uint8, b uint8)
- func (gp *Fpdf) SetSubject(subjectStr string)
- func (gp *Fpdf) SetTextColor(r uint8, g uint8, b uint8)
- func (gp *Fpdf) SetTitle(titleStr string)
- func (gp *Fpdf) SetTrimBox(x, y, w, h float64)
- func (gp *Fpdf) SetX(x float64)
- func (gp *Fpdf) SetXY(x, y float64)
- func (gp *Fpdf) SetY(y float64)
- func (gp *Fpdf) Template(corner Point) (*FpdfTpl, error)
- func (gp *Fpdf) Text(x, y float64, text string) error
- func (gp *Fpdf) Transform(tm TransformMatrix)
- func (gp *Fpdf) TransformBegin()
- func (gp *Fpdf) TransformEnd()
- func (gp *Fpdf) TransformMirrorHorizontal(x float64)
- func (gp *Fpdf) TransformMirrorLine(angle, x, y float64)
- func (gp *Fpdf) TransformMirrorPoint(x, y float64)
- func (gp *Fpdf) TransformMirrorVertical(y float64)
- func (gp *Fpdf) TransformRotate(angle, x, y float64)
- func (gp *Fpdf) TransformScale(scaleWd, scaleHt, x, y float64) error
- func (gp *Fpdf) TransformScaleX(scaleWd, x, y float64)
- func (gp *Fpdf) TransformScaleXY(s, x, y float64)
- func (gp *Fpdf) TransformScaleY(scaleHt, x, y float64)
- func (gp *Fpdf) TransformSkew(angleX, angleY, x, y float64) error
- func (gp *Fpdf) TransformSkewX(angleX, x, y float64) error
- func (gp *Fpdf) TransformSkewY(angleY, x, y float64) error
- func (gp *Fpdf) TransformTranslate(tx, ty float64)
- func (gp *Fpdf) TransformTranslateX(tx float64)
- func (gp *Fpdf) TransformTranslateY(ty float64)
- func (gp *Fpdf) UnitsToPoints(u float64) float64
- func (gp *Fpdf) UnitsToPointsVar(u ...*float64)
- func (gp *Fpdf) UseTemplate(t Template) error
- func (gp *Fpdf) UseTemplateScaled(t Template, corner Point, size Rect) error
- func (gp *Fpdf) Write(w io.Writer) error
- func (gp *Fpdf) WritePdf(pdfPath string) error
- func (gp *Fpdf) WriteText(h float64, txtStr string) error
- func (gp *Fpdf) WriteTextOpts(h float64, txtStr string, opts CellOption, textOpts TextOption) error
- func (gp *Fpdf) WriteTextOptsf(h float64, txtStr string, opts CellOption, textOpts TextOption, ...) error
- func (gp *Fpdf) WriteTextf(h float64, txtStr string, v ...interface{}) error
- func (gp *Fpdf) X() float64
- func (gp *Fpdf) XY() (float64, float64)
- func (gp *Fpdf) Y() float64
- type FpdfTpl
- func (t *FpdfTpl) Bytes() []byte
- func (t *FpdfTpl) Fonts() []*SubsetFontObj
- 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() []*ImageObj
- func (t *FpdfTpl) NumPages() int
- func (t *FpdfTpl) Serialize() ([]byte, error)
- func (t *FpdfTpl) Size() (corner Point, size Rect)
- func (t *FpdfTpl) Templates() []Template
- type FuncKernOverride
- type IFont
- type IObj
- type ImageHolder
- type ImageObj
- func (i *ImageObj) GetRect() *Rect
- func (s *ImageObj) GobDecode(buf []byte) error
- func (s *ImageObj) GobEncode() ([]byte, error)
- func (i *ImageObj) Parse() error
- func (i *ImageObj) Serialize() ([]byte, error)
- func (i *ImageObj) SetImage(r io.Reader) error
- func (i *ImageObj) SetImagePath(path string) error
- type MapOfCharacterToGlyphIndex
- func (m *MapOfCharacterToGlyphIndex) AllKeys() []rune
- func (m *MapOfCharacterToGlyphIndex) AllKeysString() string
- func (m *MapOfCharacterToGlyphIndex) AllVals() []uint
- func (s *MapOfCharacterToGlyphIndex) GobDecode(buf []byte) error
- func (s *MapOfCharacterToGlyphIndex) GobEncode() ([]byte, error)
- func (m *MapOfCharacterToGlyphIndex) Index(k rune) (int, bool)
- func (m *MapOfCharacterToGlyphIndex) KeyExists(k rune) bool
- func (m *MapOfCharacterToGlyphIndex) Set(k rune, v uint)
- func (m *MapOfCharacterToGlyphIndex) Val(k rune) (uint, bool)
- type Margins
- type PDFProtection
- type PDFProtectionConfig
- type PageBoundary
- func NewArtPageBoundary(u int, x, y, w, h float64) *PageBoundary
- func NewBleedPageBoundary(u int, x, y, w, h float64) *PageBoundary
- func NewCropPageBoundary(u int, x, y, w, h float64) *PageBoundary
- func NewPageBoundary(u int, t int, x, y, w, h float64) (*PageBoundary, error)
- func NewPageSizeBoundary(u int, w, h float64) *PageBoundary
- func NewTrimPageBoundary(u int, x, y, w, h float64) *PageBoundary
- type PageObj
- type PageOption
- type PagesObj
- type PdfDictionaryObj
- type PdfInfo
- type PdfOption
- func PdfOptionArtBox(x, y, w, h float64) PdfOption
- func PdfOptionAuthor(author string) PdfOption
- func PdfOptionBleedBox(x, y, w, h float64) PdfOption
- func PdfOptionCompress(level int) PdfOption
- func PdfOptionCreator(creator string) PdfOption
- func PdfOptionCropBox(x, y, w, h float64) PdfOption
- func PdfOptionKeywords(keywords string) PdfOption
- func PdfOptionMargin(l, t, r, b float64) PdfOption
- func PdfOptionMediaBox(x, y, w, h float64) PdfOption
- func PdfOptionNoCompress() PdfOption
- func PdfOptionPageBoundary(t int, x, y, w, h float64) PdfOption
- func PdfOptionPageSize(w, h float64) PdfOption
- func PdfOptionProducer(producer string) PdfOption
- func PdfOptionProtection(permissions int, userpass string, ownerpass string) PdfOption
- func PdfOptionSubject(subject string) PdfOption
- func PdfOptionTitle(title string) PdfOption
- func PdfOptionTrimBox(x, y, w, h float64) PdfOption
- func PdfOptionUnit(unit int) PdfOption
- type Point
- type Points
- type ProcSetObj
- type ProcsetIObj
- type RealteXobject
- type RealteXobjects
- type Rect
- type RelateFont
- type RelateFonts
- type Rgb
- type SMask
- type SubfontDescriptorObj
- type SubsetFontObj
- func (s *SubsetFontObj) AddChars(txt string) error
- func (s *SubsetFontObj) CharCodeToGlyphIndex(r rune) (uint, error)
- func (s *SubsetFontObj) CharIndex(r rune) (uint, error)
- func (s *SubsetFontObj) CharWidth(r rune) (uint, error)
- func (s *SubsetFontObj) Copy() *SubsetFontObj
- func (s *SubsetFontObj) GetFamily() string
- func (s *SubsetFontObj) GetTTFParser() *core.TTFParser
- func (s *SubsetFontObj) GetTtfFontOption() TtfOption
- func (s *SubsetFontObj) GetUp() int
- func (s *SubsetFontObj) GetUt() int
- func (s *SubsetFontObj) GlyphIndexToPdfWidth(glyphIndex uint) uint
- func (s *SubsetFontObj) GobDecode(buf []byte) error
- func (s *SubsetFontObj) GobEncode() ([]byte, error)
- func (s *SubsetFontObj) KernValueByLeft(left uint) (bool, *core.KernValue)
- func (s *SubsetFontObj) Serialize() ([]byte, error)
- func (s *SubsetFontObj) SetFamily(familyname string)
- func (s *SubsetFontObj) SetIndexObjCIDFont(index int)
- func (s *SubsetFontObj) SetIndexObjUnicodeMap(index int)
- func (s *SubsetFontObj) SetTTFByPath(ttfpath string) error
- func (s *SubsetFontObj) SetTTFByReader(rd io.Reader) error
- func (s *SubsetFontObj) SetTtfFontOption(option TtfOption)
- func (s *SubsetFontObj) ToTemplateFont() *TemplateFont
- type Template
- type TemplateFont
- type TemplateImage
- type TemplateObj
- type TextOption
- type TplFunc
- type TransformMatrix
- type TtfOption
- type UnicodeMap
Constants ¶
const ( //Regular - font style regular Regular = 0 //000000 //Italic - font style italic Italic = 1 //000001 //Bold - font style bold Bold = 2 //000010 //Underline - font style underline Underline = 4 //000100 )
const ( CapStyleDefault = iota CapStyleRound CapStyleSquare )
const ( JoinStyleRound = 1 JoinStyleBevel = 2 JoinStyleDefault = 0 )
const ( PageBoundaryCrop = iota PageBoundaryMedia PageBoundaryBleed PageBoundaryTrim PageBoundaryArt )
Page boundary types
const ( //PermissionsPrint setProtection print PermissionsPrint = 4 //PermissionsModify setProtection modify PermissionsModify = 8 //PermissionsCopy setProtection copy PermissionsCopy = 16 //PermissionsAnnotForms setProtection annot-forms PermissionsAnnotForms = 32 )
const ( Unit_Unset = iota // No units were set, when conversion is called on nothing will happen Unit_PT // Points Unit_MM // Millimeters Unit_CM // centimeters Unit_IN // inches )
The units that can be used in the document
const ARG_1_AND_2_ARE_WORDS = 1
const Bottom = 1 //000001
Bottom bottom
const Center = 16 //010000
Center center
const ContentTypeCell = 0
ContentTypeCell cell
const ContentTypeText = 1
ContentTypeText text
const Left = 8 //001000
Left left
const MORE_COMPONENTS = 32
const Middle = 32 //100000
Middle middle
const Right = 2 //000010
Right right
const Top = 4 //000100
Top top
const WE_HAVE_AN_X_AND_Y_SCALE = 64
const WE_HAVE_A_SCALE = 8
const WE_HAVE_A_TWO_BY_TWO = 128
Variables ¶
var EntrySelectors = []int{
0, 0, 1, 1, 2, 2,
2, 2, 3, 3, 3, 3,
3, 3, 3, 3, 4, 4,
4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4,
}
EntrySelectors entry selectors
var ErrCharNotFound = errors.New("char not found")
ErrCharNotFound char not found
var ErrNotSupportShortIndexYet = errors.New("not suport none short index yet")
ErrNotSupportShortIndexYet not suport none short index yet
var PageSize10x14 = Rect{W: 720, H: 1008, /* contains filtered or unexported fields */}
var PageSizeA0 = Rect{W: 2384, H: 3371, /* contains filtered or unexported fields */}
var PageSizeA1 = Rect{W: 1685, H: 2384, /* contains filtered or unexported fields */}
var PageSizeA2 = Rect{W: 1190, H: 1684, /* contains filtered or unexported fields */}
var PageSizeA3 = Rect{W: 842, H: 1190, /* contains filtered or unexported fields */}
var PageSizeA4 = Rect{W: 595, H: 842, /* contains filtered or unexported fields */}
var PageSizeA4Small = Rect{W: 595, H: 842, /* contains filtered or unexported fields */}
var PageSizeA5 = Rect{W: 420, H: 595, /* contains filtered or unexported fields */}
var PageSizeB4 = Rect{W: 729, H: 1032, /* contains filtered or unexported fields */}
var PageSizeB5 = Rect{W: 516, H: 729, /* contains filtered or unexported fields */}
var PageSizeExecutive = Rect{W: 540, H: 720, /* contains filtered or unexported fields */}
var PageSizeFolio = Rect{W: 612, H: 936, /* contains filtered or unexported fields */}
var PageSizeLedger = Rect{W: 1224, H: 792, /* contains filtered or unexported fields */}
var PageSizeLegal = Rect{W: 612, H: 1008, /* contains filtered or unexported fields */}
var PageSizeLetter = Rect{W: 612, H: 792, /* contains filtered or unexported fields */}
var PageSizeLetterSmall = Rect{W: 612, H: 792, /* contains filtered or unexported fields */}
var PageSizeQuarto = Rect{W: 610, H: 780, /* contains filtered or unexported fields */}
var PageSizeStatement = Rect{W: 396, H: 612, /* contains filtered or unexported fields */}
var PageSizeTabloid = Rect{W: 792, H: 1224, /* contains filtered or unexported fields */}
Functions ¶
func Coefficients ¶
func CreateEmbeddedFontSubsetName ¶
CreateEmbeddedFontSubsetName create Embedded font (subset font) name
func CurveLength ¶
func CurveLength(bc BezierCurve) float64
func DebugSubType ¶
func DebugSubType(b []byte)
func DesignUnitsToPdf ¶
DesignUnitsToPdf convert unit
func GetConvertedStyle ¶
func ImgReactagleToWH ¶
ImgReactagleToWH Rectangle to W and H
func PageBoundaryType ¶
func PointsToUnits ¶
PointsToUnits converts points to the provided units
func PointsToUnitsVar ¶
PointsToUnitsVar converts points to the provided units for all variables supplied
func ReadShortFromByte ¶
ReadShortFromByte read short from byte array
func ReadUShortFromByte ¶
ReadUShortFromByte read ushort from byte array
func StrHelperGetStringWidth ¶
StrHelperGetStringWidth get string width
func UnitsToPoints ¶
UnitsToPoints converts units of the provided type to points
func UnitsToPointsVar ¶
UnitsToPointsVar converts units of the provided type to points for all variables supplied
func WriteBytes ¶
WriteBytes writes []byte value to w io.Writer
func WriteUInt16 ¶
WriteUInt16 writes a 16-bit unsigned integer value to w io.Writer
Types ¶
type BezierCurve ¶
type BezierCurve struct {
Cx1, Cx2, Cx3, Cx4, Cy1, Cy2, Cy3, Cy4, Length float64
}
func NewBezierCurve ¶
func NewBezierCurve(x0, y0, cx0, cy0, cx1, cy1, x1, y1 float64) BezierCurve
func (BezierCurve) At ¶
func (bc BezierCurve) At(t float64) Point
func (BezierCurve) Curve ¶
func (bc BezierCurve) Curve(p []Point) []Point
func (BezierCurve) Dx ¶
func (bc BezierCurve) Dx(t float64) float64
func (BezierCurve) Dy ¶
func (bc BezierCurve) Dy(t float64) float64
func (BezierCurve) NormalDegrees ¶
func (bc BezierCurve) NormalDegrees(t float64) float64
func (BezierCurve) SampleByArcLength ¶
func (bc BezierCurve) SampleByArcLength(sample []float64) []float64
func (BezierCurve) Tangent ¶
func (bc BezierCurve) Tangent(t float64) Point
type BezierPoint ¶
type BezierPoint struct {
// contains filtered or unexported fields
}
type BezierSpline ¶
type BezierSpline []BezierCurve
func NewBezierSpline ¶
func NewBezierSpline(cp []Point) BezierSpline
func (BezierSpline) Length ¶
func (bs BezierSpline) Length() float64
func (BezierSpline) SampleByArcLength ¶
func (bs BezierSpline) SampleByArcLength(n int) BezierSplineSample
type BezierSplineSample ¶
type BezierSplineSample [][]float64
type CIDFontObj ¶
type CIDFontObj struct { PtrToSubsetFontObj *SubsetFontObj // contains filtered or unexported fields }
func (*CIDFontObj) SetIndexObjSubfontDescriptor ¶
func (ci *CIDFontObj) SetIndexObjSubfontDescriptor(index int)
SetIndexObjSubfontDescriptor set indexObjSubfontDescriptor
func (*CIDFontObj) SetPtrToSubsetFontObj ¶
func (ci *CIDFontObj) SetPtrToSubsetFontObj(ptr *SubsetFontObj)
SetPtrToSubsetFontObj set PtrToSubsetFontObj
type CacheContent ¶
type CacheContent struct {
// contains filtered or unexported fields
}
CacheContent Export cacheContent
func (*CacheContent) Setup ¶
func (c *CacheContent) Setup(rectangle *Rect, textColor Rgb, grayFill float64, fontObjId string, fontSize float64, fontStyle int, setXCount int, x, y float64, fontSubset *SubsetFontObj, pageheight float64, contentType int, cellOpt CellOption, lineWidth float64, )
Setup setup all infomation for cacheContent
func (*CacheContent) WriteTextToContent ¶
func (c *CacheContent) WriteTextToContent(text string)
WriteTextToContent write text to content
type CellOption ¶
type CellOption struct { Align int //Allows to align the text. Possible values are: Left,Center,Right,Top,Bottom,Middle Border int //Indicates if borders must be drawn around the cell. Possible values are: Left, Top, Right, Bottom, ALL Float int //Indicates where the current position should go after the call. Possible values are: Right, Bottom }
CellOption cell option
type ContentObj ¶
type ContentObj struct {
// contains filtered or unexported fields
}
ContentObj content object
func (*ContentObj) AppendStreamArcTo ¶
func (c *ContentObj) AppendStreamArcTo(x, y, rx, ry, degRotate, degStart, degEnd float64, styleStr string, path bool)
AppendStreamArcTo : appends an arc to
func (*ContentObj) AppendStreamClipBegin ¶
func (c *ContentObj) AppendStreamClipBegin()
AppendStreamClipBegin starts a new clip in the content
func (*ContentObj) AppendStreamClipEllipse ¶
func (c *ContentObj) AppendStreamClipEllipse(x, y, rx, ry float64, style string)
AppendStreamClipClipEllipse creates an Elliptical clipping path
func (*ContentObj) AppendStreamClipEnd ¶
func (c *ContentObj) AppendStreamClipEnd()
AppendStreamClipEnd ends a clipping path in the content
func (*ContentObj) AppendStreamClipPolygon ¶
func (c *ContentObj) AppendStreamClipPolygon(points []Point, style string)
AppendStreamClipClipEllipse creates an Elliptical clipping path
func (*ContentObj) AppendStreamClipRect ¶
func (c *ContentObj) AppendStreamClipRect(x, y, w, h float64, style string)
AppendStreamClipRect starts a rectangle clipping path
func (*ContentObj) AppendStreamClipRoundedRect ¶
func (c *ContentObj) AppendStreamClipRoundedRect(x, y, w, h, r float64, style string)
AppendStreamClipRoundedRect creates a rounded rectangle clipping path
func (*ContentObj) AppendStreamClipText ¶
func (c *ContentObj) AppendStreamClipText(x, y float64, txtStr string, style int)
AppendStreamClipText creates a clipping path using the text
func (*ContentObj) AppendStreamClosePath ¶
func (c *ContentObj) AppendStreamClosePath()
AppendStreamClosePath : appends a path closing
func (*ContentObj) AppendStreamCurve ¶
func (c *ContentObj) AppendStreamCurve(cx, cy, x, y float64)
AppendStreamCurve : appends a curve
func (*ContentObj) AppendStreamCurveBezierCubic ¶
func (c *ContentObj) AppendStreamCurveBezierCubic(cx0, cy0, cx1, cy1, x, y float64)
AppendStreamCurveBezierCubic : draw a curve from the current spot to the x and y position
func (*ContentObj) AppendStreamDrawPath ¶
func (c *ContentObj) AppendStreamDrawPath(styleStr string)
AppendStreamDrawPath : appends a draw path with style string
func (*ContentObj) AppendStreamImage ¶
func (c *ContentObj) AppendStreamImage(id string, x float64, y float64, rect Rect)
AppendStreamImage append image
func (*ContentObj) AppendStreamLine ¶
func (c *ContentObj) AppendStreamLine(x1 float64, y1 float64, x2 float64, y2 float64)
AppendStreamLine append line
func (*ContentObj) AppendStreamLineTo ¶
func (c *ContentObj) AppendStreamLineTo(x, y float64)
AppendStreamLineTo appends a line to
func (*ContentObj) AppendStreamOval ¶
func (c *ContentObj) AppendStreamOval(x1 float64, y1 float64, x2 float64, y2 float64)
AppendStreamOval append oval
func (*ContentObj) AppendStreamPoint ¶
func (c *ContentObj) AppendStreamPoint(x, y float64)
AppendStreamPoint appends a point
func (*ContentObj) AppendStreamRectangle ¶
func (c *ContentObj) AppendStreamRectangle(x float64, y float64, wdth float64, hght float64, style string)
AppendStreamRectangle : draw rectangle from lower-left corner (x, y) with specif width/height
func (*ContentObj) AppendStreamSetCMYKColorFill ¶
func (c *ContentObj) AppendStreamSetCMYKColorFill(cy uint8, m uint8, y uint8, k uint8)
AppendStreamSetCMYKColorFill set the color fill using CMYK
func (*ContentObj) AppendStreamSetCMYKColorStroke ¶
func (c *ContentObj) AppendStreamSetCMYKColorStroke(cy uint8, m uint8, y uint8, k uint8)
AppendStreamSetCMYKColorStroke set the color stroke using CMYK
func (*ContentObj) AppendStreamSetCapStyle ¶
func (c *ContentObj) AppendStreamSetCapStyle(t int)
AppendStreamSetLineType set the line type
func (*ContentObj) AppendStreamSetGrayFill ¶
func (c *ContentObj) AppendStreamSetGrayFill(w float64)
AppendStreamSetGrayFill set the grayscale fills
func (*ContentObj) AppendStreamSetGrayStroke ¶
func (c *ContentObj) AppendStreamSetGrayStroke(w float64)
AppendStreamSetGrayStroke set the grayscale stroke
func (*ContentObj) AppendStreamSetJoinStyle ¶
func (c *ContentObj) AppendStreamSetJoinStyle(t int)
AppendStreamSetJoinType set the line type
func (*ContentObj) AppendStreamSetLineType ¶
func (c *ContentObj) AppendStreamSetLineType(t string)
AppendStreamSetLineType : Set linetype [solid, dashed, dotted]
func (*ContentObj) AppendStreamSetLineWidth ¶
func (c *ContentObj) AppendStreamSetLineWidth(w float64)
AppendStreamSetLineWidth : set line width
func (*ContentObj) AppendStreamSetRGBColorFill ¶
func (c *ContentObj) AppendStreamSetRGBColorFill(r uint8, g uint8, b uint8)
AppendStreamSetRGBColorFill set the color fill using RB
func (*ContentObj) AppendStreamSetRGBColorStroke ¶
func (c *ContentObj) AppendStreamSetRGBColorStroke(r uint8, g uint8, b uint8)
AppendStreamSetRGBColorStroke set the color stroke using RGB
func (*ContentObj) AppendStreamSubsetFont ¶
func (c *ContentObj) AppendStreamSubsetFont(rectangle Rect, text string, cellOpt CellOption, textOpts TextOption) error
AppendStreamSubsetFont add stream of text
func (*ContentObj) AppendStreamText ¶
func (c *ContentObj) AppendStreamText(text string) error
AppendStreamText append text
func (*ContentObj) AppendStreamTransform ¶
func (c *ContentObj) AppendStreamTransform(matrix TransformMatrix)
AppendStreamTransform applies the transformation matrix to the current content
func (*ContentObj) AppendStreamTransformBegin ¶
func (c *ContentObj) AppendStreamTransformBegin()
AppendStreamTransformBegin starts a transformation in the current content
func (*ContentObj) AppendStreamTransformEnd ¶
func (c *ContentObj) AppendStreamTransformEnd()
AppendStreamTransformEnd stops a transformation in the current content
func (*ContentObj) AppendStreamUseTemplate ¶
func (c *ContentObj) AppendStreamUseTemplate(id string, x, y, h, sx, sy float64)
AppendStreamUseTemplate append a use template
type Current ¶
type Current struct { X float64 Y float64 //font IndexOfFontObj int CountOfFont int CountOfL int Font_Size float64 Font_Style int // Regular|Bold|Italic|Underline Font_FontCount int Font_Type int // CURRENT_FONT_TYPE_IFONT or CURRENT_FONT_TYPE_SUBSET Font_ISubset *SubsetFontObj // Font_Type == CURRENT_FONT_TYPE_SUBSET Text_Option TextOption //page IndexOfPageObj int //img CountOfImg int // contains filtered or unexported fields }
Current current state
type DeviceRGBObj ¶
type DeviceRGBObj struct {
// contains filtered or unexported fields
}
DeviceRGBObj DeviceRGB
type EmbedFontObj ¶
type EmbedFontObj struct { Data string // contains filtered or unexported fields }
func (*EmbedFontObj) SetFont ¶
func (e *EmbedFontObj) SetFont(font IFont, zfontpath string)
type EncodingObj ¶
type EncodingObj struct {
// contains filtered or unexported fields
}
func (*EncodingObj) GetFont ¶
func (e *EncodingObj) GetFont() IFont
func (*EncodingObj) SetFont ¶
func (e *EncodingObj) SetFont(font IFont)
type EncryptionObj ¶
type EncryptionObj struct {
// contains filtered or unexported fields
}
EncryptionObj encryption object res
type FontDescItem ¶
type FontDescriptorObj ¶
type FontDescriptorObj struct {
// contains filtered or unexported fields
}
func (*FontDescriptorObj) GetFont ¶
func (f *FontDescriptorObj) GetFont() IFont
func (*FontDescriptorObj) SetFont ¶
func (f *FontDescriptorObj) SetFont(font IFont)
func (*FontDescriptorObj) SetFontFileObjRelate ¶
func (f *FontDescriptorObj) SetFontFileObjRelate(relate string)
type Fpdf ¶
type Fpdf struct {
// contains filtered or unexported fields
}
Fpdf : A simple library for generating PDF written in Go lang
func (*Fpdf) AddExternalLink ¶
AddLink
func (*Fpdf) AddInternalLink ¶
func (*Fpdf) AddPageWithOption ¶
func (gp *Fpdf) AddPageWithOption(opt PageOption)
AddPageWithOption : add new page with option
func (*Fpdf) AddTTFFont ¶
AddTTFFont : add font file
func (*Fpdf) AddTTFFontByReader ¶
AddTTFFontByReader add font file
func (*Fpdf) AddTTFFontByReaderWithOption ¶
AddTTFFontByReaderWithOption add font file
func (*Fpdf) AddTTFFontBySubsetFont ¶
func (gp *Fpdf) AddTTFFontBySubsetFont(family string, subsetFont *SubsetFontObj) error
func (*Fpdf) AddTTFFontWithOption ¶
AddTTFFontWithOption : add font file
func (*Fpdf) Arc ¶
Arc draws an elliptical arc centered at point (x, y). rx and ry specify its horizontal and vertical radii.
degRotate specifies the angle that the arc will be rotated. degStart and degEnd specify the starting and ending angle of the arc. All angles are specified in degrees and measured counter-clockwise from the 3 o'clock position.
styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for outlined and filled. An empty string will be replaced with "D". Drawing uses the current draw color, line width, and cap style centered on the arc's path. Filling uses the current fill color.
The Circle() example demonstrates this method.
func (*Fpdf) ArcTo ¶
ArcTo draws an elliptical arc centered at point (x, y). rx and ry specify its horizontal and vertical radii. If the start of the arc is not at the current position, a connecting line will be drawn.
degRotate specifies the angle that the arc will be rotated. degStart and degEnd specify the starting and ending angle of the arc. All angles are specified in degrees and measured counter-clockwise from the 3 o'clock position.
styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for outlined and filled. An empty string will be replaced with "D". Drawing uses the current draw color, line width, and cap style centered on the arc's path. Filling uses the current fill color.
The MoveTo() example demonstrates this method.
func (*Fpdf) Beziergon ¶
Beziergon draws a closed figure defined by a series of cubic Bézier curve segments. The first point in the slice defines the starting point of the figure. Each three following points p1, p2, p3 represent a curve segment to the point p3 using p1 and p2 as the Bézier control points.
The x and y fields of the points use the units established in New().
styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for outlined and filled. An empty string will be replaced with "D". Drawing uses the current draw color and line width centered on the ellipse's perimeter. Filling uses the current fill color.
func (*Fpdf) Beziertext ¶
func (gp *Fpdf) Beziertext(pts Points, startBracket, endBracket float64, text string, opt CellOption, textOpt TextOption) error
Beziertext writes text along a path defined by a series of cubic Bézier curve segments. Font size is reduced if the text exceeds avaiable arc length.
func (*Fpdf) Cell ¶
Cell : create cell of text ( use current x,y is upper-left corner of cell) Note that this has no effect on Rect.H pdf (now). Fix later :-)
func (*Fpdf) CellWithOption ¶
func (gp *Fpdf) CellWithOption(w, h float64, text string, opt CellOption, textOpts TextOption) error
CellWithOption create cell of text ( use current x,y is upper-left corner of cell)
func (*Fpdf) Circle ¶
Circle draws a circle centered on point (x, y) with radius r.
styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for outlined and filled. An empty string will be replaced with "D". Drawing uses the current draw color and line width centered on the circle's perimeter. Filling uses the current fill color.
func (*Fpdf) ClipCircle ¶
ClipCircle begins a circular clipping operation. The circle is centered at (x, y) and has radius r. outline is true to draw a border with the current draw color and line width centered on the circle's perimeter. Only the outer half of the border will be shown. After calling this method, all rendering operations (for example, Image(), LinearGradient(), etc) will be clipped by the specified circle. Call ClipEnd() to restore unclipped operations.
The ClipText() example demonstrates this method.
func (*Fpdf) ClipEllipse ¶
ClipEllipse begins an elliptical clipping operation. The ellipse is centered at (x, y). Its horizontal and vertical radii are specified by rx and ry. outline is true to draw a border with the current draw color and line width centered on the ellipse's perimeter. Only the outer half of the border will be shown. After calling this method, all rendering operations (for example, Image(), LinearGradient(), etc) will be clipped by the specified ellipse. Call ClipEnd() to restore unclipped operations.
This ClipText() example demonstrates this method.
func (*Fpdf) ClipEnd ¶
func (gp *Fpdf) ClipEnd()
ClipEnd ends a clipping operation that was started with a call to ClipRect(), ClipRoundedRect(), ClipText(), ClipEllipse(), ClipCircle() or ClipPolygon(). Clipping operations can be nested. The document cannot be successfully output while a clipping operation is active.
The ClipText() example demonstrates this method.
func (*Fpdf) ClipPolygon ¶
ClipPolygon begins a clipping operation within a polygon. The figure is defined by a series of vertices specified by points. The x and y fields of the points use the units established in New(). The last point in the slice will be implicitly joined to the first to close the polygon. outline is true to draw a border with the current draw color and line width centered on the polygon's perimeter. Only the outer half of the border will be shown. After calling this method, all rendering operations (for example, Image(), LinearGradient(), etc) will be clipped by the specified polygon. Call ClipEnd() to restore unclipped operations.
The ClipText() example demonstrates this method.
func (*Fpdf) ClipRect ¶
ClipRect begins a rectangular clipping operation. The rectangle is of width w and height h. Its upper left corner is positioned at point (x, y). outline is true to draw a border with the current draw color and line width centered on the rectangle's perimeter. Only the outer half of the border will be shown. After calling this method, all rendering operations (for example, Image(), LinearGradient(), etc) will be clipped by the specified rectangle. Call ClipEnd() to restore unclipped operations.
This ClipText() example demonstrates this method.
func (*Fpdf) ClipRoundedRect ¶
ClipRoundedRect begins a rectangular clipping operation. The rectangle is of width w and height h. Its upper left corner is positioned at point (x, y). The rounded corners of the rectangle are specified by radius r. outline is true to draw a border with the current draw color and line width centered on the rectangle's perimeter. Only the outer half of the border will be shown. After calling this method, all rendering operations (for example, Image(), LinearGradient(), etc) will be clipped by the specified rectangle. Call ClipEnd() to restore unclipped operations.
This ClipText() example demonstrates this method.
func (*Fpdf) ClipText ¶
ClipText begins a clipping operation in which rendering is confined to the character string specified by txtStr. The origin (x, y) is on the left of the first character at the baseline. The current font is used. outline is true to draw a border with the current draw color and line width centered on the perimeters of the text characters. Only the outer half of the border will be shown. After calling this method, all rendering operations (for example, Image(), LinearGradient(), etc) will be clipped. Call ClipEnd() to restore unclipped operations.
func (*Fpdf) ClosePath ¶
func (gp *Fpdf) ClosePath()
ClosePath creates a line from the current location to the last MoveTo point (if not the same) and mark the path as closed so the first and last lines join nicely.
The MoveTo() example demonstrates this method.
func (*Fpdf) CreateTemplate ¶
CreateTemplate defines a new template using the current page size.
func (*Fpdf) CreateTemplateCustom ¶
CreateTemplateCustom starts a template, using the given bounds.
func (*Fpdf) Curve ¶
Curve draws a single-segment quadratic Bézier curve. The curve starts at the point (x0, y0) and ends at the point (x1, y1). The control point (cx, cy) specifies the curvature. At the start point, the curve is tangent to the straight line between the start point and the control point. At the end point, the curve is tangent to the straight line between the end point and the control point.
styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for outlined and filled. An empty string will be replaced with "D". Drawing uses the current draw color, line width, and cap style centered on the curve's path. Filling uses the current fill color.
The Circle() example demonstrates this method.
func (*Fpdf) CurveBezierCubic ¶
CurveBezierCubic draws a single-segment cubic Bézier curve. The curve starts at the point (x0, y0) and ends at the point (x1, y1). The control points (cx0, cy0) and (cx1, cy1) specify the curvature. At the start point, the curve is tangent to the straight line between the start point and the control point (cx0, cy0). At the end point, the curve is tangent to the straight line between the end point and the control point (cx1, cy1).
styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for outlined and filled. An empty string will be replaced with "D". Drawing uses the current draw color, line width, and cap style centered on the curve's path. Filling uses the current fill color.
This routine performs the same function as CurveCubic() but uses standard argument order.
The Circle() example demonstrates this method.
func (*Fpdf) CurveBezierCubicTo ¶
CurveBezierCubicTo creates a single-segment cubic Bézier curve. The curve starts at the current stylus location and ends at the point (x, y). The control points (cx0, cy0) and (cx1, cy1) specify the curvature. At the current stylus, the curve is tangent to the straight line between the current stylus location and the control point (cx0, cy0). At the end point, the curve is tangent to the straight line between the end point and the control point (cx1, cy1).
The MoveTo() example demonstrates this method.
func (*Fpdf) CurveCubic ¶
CurveCubic draws a single-segment cubic Bézier curve. This routine performs the same function as CurveBezierCubic() but has a nonstandard argument order. It is retained to preserve backward compatibility.
func (*Fpdf) DrawPath ¶
DrawPath actually draws the path on the page.
styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for outlined and filled. An empty string will be replaced with "D". Path-painting operators as defined in the PDF specification are also allowed: "S" (Stroke the path), "s" (Close and stroke the path), "f" (fill the path, using the nonzero winding number), "f*" (Fill the path, using the even-odd rule), "B" (Fill and then stroke the path, using the nonzero winding number rule), "B*" (Fill and then stroke the path, using the even-odd rule), "b" (Close, fill, and then stroke the path, using the nonzero winding number rule) and "b*" (Close, fill, and then stroke the path, using the even-odd rule). Drawing uses the current draw color, line width, and cap style centered on the path. Filling uses the current fill color.
The MoveTo() example demonstrates this method.
func (*Fpdf) DrawPrinterMarks ¶ added in v0.1.16
func (gp *Fpdf) DrawPrinterMarks()
func (*Fpdf) Ellipse ¶
Ellipse draws an ellipse centered at point (x, y). rx and ry specify its horizontal and vertical radii.
degRotate specifies the counter-clockwise angle in degrees that the ellipse will be rotated.
styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for outlined and filled. An empty string will be replaced with "D". Drawing uses the current draw color and line width centered on the ellipse's perimeter. Filling uses the current fill color.
The Circle() example demonstrates this method.
func (*Fpdf) GetBoundaryHeight ¶
func (*Fpdf) GetBoundaryPosition ¶
func (*Fpdf) GetBoundarySize ¶
func (*Fpdf) GetBoundaryWidth ¶
func (*Fpdf) GetBoundaryX ¶
func (*Fpdf) GetBoundaryY ¶
func (*Fpdf) GetBytesPdfReturnErr ¶
GetBytesPdfReturnErr : get bytes of pdf file
func (*Fpdf) GetPageBoundary ¶
func (gp *Fpdf) GetPageBoundary(t int) *PageBoundary
func (*Fpdf) ImageByHolder ¶
ImageByHolder : draw image by ImageHolder
func (*Fpdf) ImageByObj ¶
func (*Fpdf) ImageByReader ¶
ImageByReader adds an image to the pdf with a reader
func (*Fpdf) ImageByURL ¶
ImageByURL adds an image to the pdf using the given url
func (*Fpdf) KernOverride ¶
func (gp *Fpdf) KernOverride(family string, fn FuncKernOverride) error
KernOverride override kern value
func (*Fpdf) LineTo ¶
LineTo creates a line from the current stylus location to (x, y), which becomes the new stylus location. Note that this only creates the line in the path; it does not actually draw the line on the page.
The MoveTo() example demonstrates this method.
func (*Fpdf) Ln ¶
Ln performs a line break. The current abscissa goes back to the left margin and the ordinate increases by the amount passed in parameter. This method is demonstrated in the example for MultiCell.
func (*Fpdf) MarginBottom ¶
MarginBottom returns the bottom margin
func (*Fpdf) MarginRight ¶
MarginRight returns the right margin
func (*Fpdf) Margins ¶
Margins gets the current margins, The margins will be converted back to the documents units. Returned values will be in the following order Left, Top, Right, Bottom
func (*Fpdf) MeasureTextWidth ¶
func (gp *Fpdf) MeasureTextWidth(text string, textOpt TextOption) (float64, error)
MeasureTextWidth : measure Width of text (use current font)
func (*Fpdf) MoveTo ¶
MoveTo moves the stylus to (x, y) without drawing the path from the previous point. Paths must start with a MoveTo to set the original stylus location or the result is undefined.
Create a "path" by moving a virtual stylus around the page (with MoveTo, LineTo, CurveTo, CurveBezierCubicTo, ArcTo & ClosePath) then draw it or fill it in (with DrawPath). The main advantage of using the path drawing routines rather than multiple Fpdf.Line is that PDF creates nice line joins at the angles, rather than just overlaying the lines.
func (*Fpdf) MultiCell ¶
MultiCell supports printing text with line breaks. They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the \n character). As many cells as necessary are output, one below the other.
Text can be aligned, centered or justified. The cell block can be framed and the background painted. See CellFormat() for more details.
The current position after calling MultiCell() is the beginning of the next line, equivalent to calling CellFormat with ln equal to 1.
w is the width of the cells. A value of zero indicates cells that reach to the right margin.
h indicates the line height of each cell in the unit of measure specified in New().
func (*Fpdf) MultiCellOpts ¶
func (gp *Fpdf) MultiCellOpts(w, h float64, txtStr string, opts CellOption, textOpts TextOption) error
MultiCell supports printing text with line breaks. They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the \n character). As many cells as necessary are output, one below the other.
Text can be aligned, centered or justified. The cell block can be framed and the background painted. See CellFormat() for more details.
The current position after calling MultiCell() is the beginning of the next line, equivalent to calling CellFormat with ln equal to 1.
w is the width of the cells. A value of zero indicates cells that reach to the right margin.
h indicates the line height of each cell in the unit of measure specified in New().
func (*Fpdf) NewArtPageBoundary ¶
func (gp *Fpdf) NewArtPageBoundary(x, y, w, h float64) *PageBoundary
func (*Fpdf) NewBleedPageBoundary ¶
func (gp *Fpdf) NewBleedPageBoundary(x, y, w, h float64) *PageBoundary
func (*Fpdf) NewCropPageBoundary ¶
func (gp *Fpdf) NewCropPageBoundary(x, y, w, h float64) *PageBoundary
func (*Fpdf) NewPageBoundary ¶
func (gp *Fpdf) NewPageBoundary(t int, x, y, w, h float64) (*PageBoundary, error)
func (*Fpdf) NewPageOption ¶
func (gp *Fpdf) NewPageOption(w, h float64) *PageOption
func (*Fpdf) NewPageSizeBoundary ¶
func (gp *Fpdf) NewPageSizeBoundary(w, h float64) *PageBoundary
func (*Fpdf) NewTrimPageBoundary ¶
func (gp *Fpdf) NewTrimPageBoundary(x, y, w, h float64) *PageBoundary
func (*Fpdf) PointsToUnits ¶
PointsToUnits converts the points to the documents unit type
func (*Fpdf) PointsToUnitsVar ¶
PointsToUnits converts the points to the documents unit type for all variables passed in
func (*Fpdf) RectFromLowerLeft ¶
RectFromLowerLeft : draw rectangle from lower-left corner (x, y)
func (*Fpdf) RectFromLowerLeftWithStyle ¶
func (gp *Fpdf) RectFromLowerLeftWithStyle(x float64, y float64, wdth float64, hght float64, style string)
RectFromLowerLeftWithStyle : draw rectangle from lower-left corner (x, y)
- style: Style of rectangule (draw and/or fill: D, F, DF, FD) D or empty string: draw. This is the default value. F: fill DF or FD: draw and fill
func (*Fpdf) RectFromUpperLeft ¶
RectFromUpperLeft : draw rectangle from upper-left corner (x, y)
func (*Fpdf) RectFromUpperLeftWithStyle ¶
func (gp *Fpdf) RectFromUpperLeftWithStyle(x float64, y float64, wdth float64, hght float64, style string)
RectFromUpperLeftWithStyle : draw rectangle from upper-left corner (x, y)
- style: Style of rectangule (draw and/or fill: D, F, DF, FD) D or empty string: draw. This is the default value. F: fill DF or FD: draw and fill
func (*Fpdf) Rotate ¶
Rotate rotate text or image angle is angle in degrees. x, y is rotation center
func (*Fpdf) SetBleedBox ¶
func (*Fpdf) SetCMYKFillColor ¶
SetCMYKFillColor set the color for the stroke
func (*Fpdf) SetCMYKStrokeColor ¶
SetCMYKStrokeColor set the color for the stroke
func (*Fpdf) SetCompressLevel ¶
SetCompressLevel : set compress Level for content streams Possible values for level:
-2 HuffmanOnly, -1 DefaultCompression (which is level 6) 0 No compression, 1 fastest compression, but not very good ratio 9 best compression, but slowest
func (*Fpdf) SetCreator ¶
SetCreator defines the creator of the document.
func (*Fpdf) SetCropBox ¶
func (*Fpdf) SetFont ¶
SetFont : set font style support "" or "U" for "B" and "I" should be loaded apropriate fonts with same styles defined
func (*Fpdf) SetFontWithStyle ¶
SetFontWithStyle : set font style support Regular or Underline for Bold|Italic should be loaded apropriate fonts with same styles defined
func (*Fpdf) SetGrayFill ¶
SetGrayFill set the grayscale for the fill, takes a float64 between 0.0 and 1.0
func (*Fpdf) SetGrayStroke ¶
SetGrayStroke set the grayscale for the stroke, takes a float64 between 0.0 and 1.0
func (*Fpdf) SetKeywords ¶
SetKeywords defines the keywords of the document. keywordStr is a space-delimited string, for example "invoice August".
func (*Fpdf) SetLineCapStyle ¶
SetLineCapStyle defines the line cap style. styleStr should be "butt", "round" or "square". A square style projects from the end of the line. The method can be called before the first page is created. The value is retained from page to page.
func (*Fpdf) SetLineJoinStyle ¶
SetLineJoinStyle defines the line cap style. styleStr should be "miter", "round" or "bevel". The method can be called before the first page is created. The value is retained from page to page.
func (*Fpdf) SetLineType ¶
SetLineType : set line type ("dashed" ,"dotted")
Usage: pdf.SetLineType("dashed") pdf.Line(50, 200, 550, 200) pdf.SetLineType("dotted") pdf.Line(50, 400, 550, 400)
func (*Fpdf) SetLineWidth ¶
SetLineWidth : set line width
func (*Fpdf) SetMarginBottom ¶
SetMarginBottom set the bottom margin
func (*Fpdf) SetMarginLeft ¶
SetMarginLeft sets the left margin
func (*Fpdf) SetMarginRight ¶
SetMarginRight sets the right margin
func (*Fpdf) SetMarginTop ¶
SetMarginTop sets the top margin
func (*Fpdf) SetMargins ¶
SetMargins defines the left, top, right and bottom margins. By default, they equal 1 cm. Call this method to change them.
func (*Fpdf) SetNoCompression ¶
func (gp *Fpdf) SetNoCompression()
SetNoCompression : compressLevel = 0
func (*Fpdf) SetPageBoundary ¶
func (gp *Fpdf) SetPageBoundary(pb *PageBoundary)
Set a page boundary
func (*Fpdf) SetPageSize ¶
func (*Fpdf) SetProducer ¶
SetProdcer defines the producer of the document.
func (*Fpdf) SetRGBFillColor ¶
SetRGBFillColor set the color for the stroke
func (*Fpdf) SetRGBStrokeColor ¶
SetRBStrokeColor set the color for the stroke
func (*Fpdf) SetSubject ¶
SetSubject defines the subject of the document.
func (*Fpdf) SetTextColor ¶
SetTextColor : function sets the text color
func (*Fpdf) SetTrimBox ¶
func (*Fpdf) Transform ¶
func (gp *Fpdf) Transform(tm TransformMatrix)
Transform generally transforms the following text, drawings and images according to the specified matrix. It is typically easier to use the various methods such as TransformRotate() and TransformMirrorVertical() instead.
func (*Fpdf) TransformBegin ¶
func (gp *Fpdf) TransformBegin()
TransformBegin sets up a transformation context for subsequent text, drawings and images. The typical usage is to immediately follow a call to this method with a call to one or more of the transformation methods such as TransformScale(), TransformSkew(), etc. This is followed by text, drawing or image output and finally a call to TransformEnd(). All transformation contexts must be properly ended prior to outputting the document.
func (*Fpdf) TransformEnd ¶
func (gp *Fpdf) TransformEnd()
TransformEnd applies a transformation that was begun with a call to TransformBegin().
The TransformBegin() example demonstrates this method.
func (*Fpdf) TransformMirrorHorizontal ¶
TransformMirrorHorizontal horizontally mirrors the following text, drawings and images. x is the axis of reflection.
The TransformBegin() example demonstrates this method.
func (*Fpdf) TransformMirrorLine ¶
TransformMirrorLine symmetrically mirrors the following text, drawings and images on the line defined by angle and the point (x, y). angles is specified in degrees and measured counter-clockwise from the 3 o'clock position.
The TransformBegin() example demonstrates this method.
func (*Fpdf) TransformMirrorPoint ¶
TransformMirrorPoint symmetrically mirrors the following text, drawings and images on the point specified by (x, y).
The TransformBegin() example demonstrates this method.
func (*Fpdf) TransformMirrorVertical ¶
TransformMirrorVertical vertically mirrors the following text, drawings and images. y is the axis of reflection.
The TransformBegin() example demonstrates this method.
func (*Fpdf) TransformRotate ¶
TransformRotate rotates the following text, drawings and images around the center point (x, y). angle is specified in degrees and measured counter-clockwise from the 3 o'clock position.
The TransformBegin() example demonstrates this method.
func (*Fpdf) TransformScale ¶
TransformScale generally scales the following text, drawings and images. scaleWd and scaleHt are the percentage scaling factors for width and height. (x, y) is center of scaling.
The TransformBegin() example demonstrates this method.
func (*Fpdf) TransformScaleX ¶
TransformScaleX scales the width of the following text, drawings and images. scaleWd is the percentage scaling factor. (x, y) is center of scaling.
The TransformBegin() example demonstrates this method.
func (*Fpdf) TransformScaleXY ¶
TransformScaleXY uniformly scales the width and height of the following text, drawings and images. s is the percentage scaling factor for both width and height. (x, y) is center of scaling.
The TransformBegin() example demonstrates this method.
func (*Fpdf) TransformScaleY ¶
TransformScaleY scales the height of the following text, drawings and images. scaleHt is the percentage scaling factor. (x, y) is center of scaling.
The TransformBegin() example demonstrates this method.
func (*Fpdf) TransformSkew ¶
TransformSkew generally skews the following text, drawings and images keeping the point (x, y) stationary. angleX ranges from -90 degrees (skew to the left) to 90 degrees (skew to the right). angleY ranges from -90 degrees (skew to the bottom) to 90 degrees (skew to the top).
The TransformBegin() example demonstrates this method.
func (*Fpdf) TransformSkewX ¶
TransformSkewX horizontally skews the following text, drawings and images keeping the point (x, y) stationary. angleX ranges from -90 degrees (skew to the left) to 90 degrees (skew to the right).
The TransformBegin() example demonstrates this method.
func (*Fpdf) TransformSkewY ¶
TransformSkewY vertically skews the following text, drawings and images keeping the point (x, y) stationary. angleY ranges from -90 degrees (skew to the bottom) to 90 degrees (skew to the top).
The TransformBegin() example demonstrates this method.
func (*Fpdf) TransformTranslate ¶
TransformTranslate moves the following text, drawings and images horizontally and vertically by the amounts specified by tx and ty.
The TransformBegin() example demonstrates this method.
func (*Fpdf) TransformTranslateX ¶
TransformTranslateX moves the following text, drawings and images horizontally by the amount specified by tx.
The TransformBegin() example demonstrates this method.
func (*Fpdf) TransformTranslateY ¶
TransformTranslateY moves the following text, drawings and images vertically by the amount specified by ty.
The TransformBegin() example demonstrates this method.
func (*Fpdf) UnitsToPoints ¶
UnitsToPoints converts the units to the documents unit type
func (*Fpdf) UnitsToPointsVar ¶
UnitsToPointsVar converts the units to the documents unit type for all variables passed in
func (*Fpdf) UseTemplate ¶
UseTemplate adds a template to the current page or another template, using the size and position at which it was originally written.
func (*Fpdf) UseTemplateScaled ¶
UseTemplateScaled adds a template to the current page or another template, using the given page coordinates.
func (*Fpdf) WriteText ¶
WriteText prints text from the current position. When the right margin is reached (or the \n character is met) a line break occurs and text continues from the left margin. Upon method exit, the current position is left just at the end of the text.
It is possible to put a link on the text.
h indicates the line height in the unit of measure specified in New().
func (*Fpdf) WriteTextOpts ¶
func (gp *Fpdf) WriteTextOpts(h float64, txtStr string, opts CellOption, textOpts TextOption) error
WriteText prints text from the current position. When the right margin is reached (or the \n character is met) a line break occurs and text continues from the left margin. Upon method exit, the current position is left just at the end of the text.
It is possible to put a link on the text.
h indicates the line height in the unit of measure specified in New().
func (*Fpdf) WriteTextOptsf ¶
func (gp *Fpdf) WriteTextOptsf(h float64, txtStr string, opts CellOption, textOpts TextOption, v ...interface{}) error
WriteTextOptsf is the same as WriteText but it uses fmt.Sprintf
func (*Fpdf) WriteTextf ¶
WriteTextf is the same as WriteText but it uses fmt.Sprintf
type FpdfTpl ¶
type FpdfTpl struct {
// contains filtered or unexported fields
}
FpdfTpl is a concrete implementation of the Template interface.
func (*FpdfTpl) Fonts ¶
func (t *FpdfTpl) Fonts() []*SubsetFontObj
Fonts returns a list of the fonts used in the template
func (*FpdfTpl) FromPages ¶
FromPages creates a template slice with all the pages within a template.
func (*FpdfTpl) GobDecode ¶
GobDecode decodes the specified byte buffer into the receiving template.
func (*FpdfTpl) GobEncode ¶
GobEncode encodes the receiving template into a byte buffer. Use GobDecode to decode the byte buffer back to a template.
func (*FpdfTpl) NumPages ¶
NumPages returns the number of available pages within the template. Look at FromPage and FromPages on access to that content.
type FuncKernOverride ¶
type FuncKernOverride func( leftRune rune, rightRune rune, leftPair uint, rightPair uint, pairVal int16, ) int16
FuncKernOverride return your custome pair value
type IObj ¶
type IObj interface {
// contains filtered or unexported methods
}
IObj inteface for all pdf object
type ImageHolder ¶
ImageHolder hold image data
func ImageHolderByBytes ¶
func ImageHolderByBytes(b []byte) (ImageHolder, error)
ImageHolderByBytes create ImageHolder by []byte
func ImageHolderByPath ¶
func ImageHolderByPath(path string) (ImageHolder, error)
ImageHolderByPath create ImageHolder by image path
func ImageHolderByReader ¶
func ImageHolderByReader(r io.Reader) (ImageHolder, error)
ImageHolderByReader create ImageHolder by io.Reader
type ImageObj ¶
type ImageObj struct {
// contains filtered or unexported fields
}
ImageObj image object
func DeserializeImage ¶
func NewImageObj ¶
func NewImageObj(img ImageHolder) (*ImageObj, error)
func (*ImageObj) SetImagePath ¶
SetImagePath set image path
type MapOfCharacterToGlyphIndex ¶
type MapOfCharacterToGlyphIndex struct { Keys []rune Vals []uint // contains filtered or unexported fields }
MapOfCharacterToGlyphIndex map of CharacterToGlyphIndex
func NewMapOfCharacterToGlyphIndex ¶
func NewMapOfCharacterToGlyphIndex() *MapOfCharacterToGlyphIndex
NewMapOfCharacterToGlyphIndex new CharacterToGlyphIndex
func (*MapOfCharacterToGlyphIndex) AllKeys ¶
func (m *MapOfCharacterToGlyphIndex) AllKeys() []rune
AllKeys get keys
func (*MapOfCharacterToGlyphIndex) AllKeysString ¶
func (m *MapOfCharacterToGlyphIndex) AllKeysString() string
func (*MapOfCharacterToGlyphIndex) AllVals ¶
func (m *MapOfCharacterToGlyphIndex) AllVals() []uint
AllVals get all values
func (*MapOfCharacterToGlyphIndex) GobDecode ¶
func (s *MapOfCharacterToGlyphIndex) GobDecode(buf []byte) error
func (*MapOfCharacterToGlyphIndex) GobEncode ¶
func (s *MapOfCharacterToGlyphIndex) GobEncode() ([]byte, error)
func (*MapOfCharacterToGlyphIndex) Index ¶
func (m *MapOfCharacterToGlyphIndex) Index(k rune) (int, bool)
Index get index by key
func (*MapOfCharacterToGlyphIndex) KeyExists ¶
func (m *MapOfCharacterToGlyphIndex) KeyExists(k rune) bool
KeyExists key is exists?
func (*MapOfCharacterToGlyphIndex) Set ¶
func (m *MapOfCharacterToGlyphIndex) Set(k rune, v uint)
Set set key and value to map
type PDFProtection ¶
type PDFProtection struct {
// contains filtered or unexported fields
}
PDFProtection protection in pdf
func (*PDFProtection) EncryptionObj ¶
func (p *PDFProtection) EncryptionObj() *EncryptionObj
EncryptionObj get Encryption Object
func (*PDFProtection) Objectkey ¶
func (p *PDFProtection) Objectkey(objID int) []byte
Objectkey create object key from ObjID
func (*PDFProtection) SetProtection ¶
func (p *PDFProtection) SetProtection(permissions int, userPass []byte, ownerPass []byte) error
SetProtection set protection infomation
type PDFProtectionConfig ¶
type PDFProtectionConfig struct { UseProtection bool Permissions int UserPass []byte OwnerPass []byte }
PDFProtectionConfig config of pdf protection
type PageBoundary ¶
func NewArtPageBoundary ¶
func NewArtPageBoundary(u int, x, y, w, h float64) *PageBoundary
func NewBleedPageBoundary ¶
func NewBleedPageBoundary(u int, x, y, w, h float64) *PageBoundary
func NewCropPageBoundary ¶
func NewCropPageBoundary(u int, x, y, w, h float64) *PageBoundary
func NewPageBoundary ¶
func NewPageBoundary(u int, t int, x, y, w, h float64) (*PageBoundary, error)
func NewPageSizeBoundary ¶
func NewPageSizeBoundary(u int, w, h float64) *PageBoundary
func NewTrimPageBoundary ¶
func NewTrimPageBoundary(u int, x, y, w, h float64) *PageBoundary
type PageObj ¶
type PageObj struct { ResourcesRelate string Links []linkOption // contains filtered or unexported fields }
PageObj pdf page object
type PageOption ¶
type PageOption struct {
PageBoundaries [5]*PageBoundary
}
PageOption option of page
func NewPageOption ¶
func NewPageOption(u int, w, h float64) (po *PageOption)
func (*PageOption) AddPageBoundary ¶
func (po *PageOption) AddPageBoundary(pb *PageBoundary)
func (*PageOption) GetBoundary ¶
func (po *PageOption) GetBoundary(t int) *PageBoundary
func (*PageOption) IsEmpty ¶
func (po *PageOption) IsEmpty() bool
type PdfDictionaryObj ¶
type PdfDictionaryObj struct { PtrToSubsetFontObj *SubsetFontObj // contains filtered or unexported fields }
PdfDictionaryObj pdf dictionary object
func (*PdfDictionaryObj) AddCompositeGlyphs ¶
func (p *PdfDictionaryObj) AddCompositeGlyphs(glyphArray *[]int, glyph int)
AddCompositeGlyphs add composite glyph composite glyph is a Unicode entity that can be defined as a sequence of one or more other characters.
func (*PdfDictionaryObj) GetOffset ¶
func (p *PdfDictionaryObj) GetOffset(glyph int) int
GetOffset get offset from glyf table
func (*PdfDictionaryObj) SetPtrToSubsetFontObj ¶
func (p *PdfDictionaryObj) SetPtrToSubsetFontObj(ptr *SubsetFontObj)
SetPtrToSubsetFontObj set subsetFontObj pointer
type PdfInfo ¶
type PdfInfo struct { Title string //The document’s title Author string //The name of the person who created the document. Subject string //The subject of the document. Creator string // If the document was converted to PDF from another format, the name of the application original document from which it was converted. Producer string //If the document was converted to PDF from another format, the name of the application (for example, Acrobat Distiller) that converted it to PDF. Keywords string // The keywords associated with the document }
PdfInfo Document Information Dictionary
type PdfOption ¶
type PdfOption interface {
// contains filtered or unexported methods
}
A pdf option is passed into the New method to set up the initial state of the pdf being generated.
func PdfOptionArtBox ¶
PdfOptionArtBox creates a PdfOption that sets the documents ArtBox
func PdfOptionAuthor ¶
PdfOptionAuthor creates a PdfOption that sets the author of the document
func PdfOptionBleedBox ¶
PdfOptionBleedBox creates a PdfOption that sets the documents BleedBox
func PdfOptionCompress ¶
PdfOptionCompress creates a PdfOption that sets the compression level of the document
func PdfOptionCreator ¶
PdfOptionCreator creates a PdfOption that sets the creator of the document
func PdfOptionCropBox ¶
PdfOptionCropBox creates a PdfOption that sets the documents CropBox
func PdfOptionKeywords ¶
PdfOptionKeywords creates a PdfOption that sets the keywords of the document
func PdfOptionMargin ¶
PdfOptionMargin creates a new PdfOption that sets the margins of the pdf
func PdfOptionMediaBox ¶
PdfOptionMediaBox creates a PdfOption that sets the documents MediaBox
func PdfOptionNoCompress ¶
func PdfOptionNoCompress() PdfOption
PdfOptionNoCompress creates a PdfOption that sets the compression level to none.
func PdfOptionPageBoundary ¶
PdfOptionPageBoundary creates a PdfOption that sets a page boundary. Options that can be set are MediaBox, BleedBox, TrimBox, CropBox and ArtBox
func PdfOptionPageSize ¶
PdfOptionPageSize creates a PdfOption that sets the size of the document. This also sets the size of the MediaBox
func PdfOptionProducer ¶
PdfOptionProducer creates a PdfOption that sets the producer of the document
func PdfOptionProtection ¶
PdfOptionProtection creates a PdfOption that set the protection for the document
func PdfOptionSubject ¶
PdfOptionSubject creates a PdfOption that sets the subject of the document
func PdfOptionTitle ¶
PdfOptionTitle creates a PdfOption that sets the title of the document
func PdfOptionTrimBox ¶
PdfOptionTrimBox creates a PdfOption that sets the documents TrimBox
func PdfOptionUnit ¶
PdfOptionUnit Creates an option that sets the pdf unit
type Point ¶
type Point struct {
X, Y float64
}
Point fields X and Y specify the horizontal and vertical coordinates of a point, typically used in drawing.
func ParsePoints ¶
type Points ¶
type Points []Point
An array of Point objects
type ProcSetObj ¶
type ProcSetObj struct { //Font Realtes RelateFonts RealteXobjs RealteXobjects // contains filtered or unexported fields }
ProcSetObj pdf procSet object
type ProcsetIObj ¶
type ProcsetIObj interface { IObj // contains filtered or unexported methods }
ProcsetIObj interface for all pdf objects that need to be registerd to the procset
type RealteXobject ¶
type RealteXobjects ¶
type RealteXobjects []RealteXobject
type Rect ¶
Rect is Basic 2d rectangle object for defining objects sizes
func (Rect) PointsToUnits ¶
PointsToUnits converts the rectanlges width and height to Units. When this is called it is assumed the values of the rectangle are in Points
func (Rect) UnitsToPoints ¶
UnitsToPoints converts the rectanlges width and height to Points. When this is called it is assumed the values of the rectangle are in Units
type RelateFont ¶
type RelateFonts ¶
type RelateFonts []RelateFont
func (RelateFonts) IsContainsFamily ¶
func (re RelateFonts) IsContainsFamily(family string) bool
func (RelateFonts) IsContainsFamilyAndStyle ¶
func (re RelateFonts) IsContainsFamilyAndStyle(family string, style int) bool
IsContainsFamilyAndStyle - checks if already exists font with same name and style
type SubfontDescriptorObj ¶
type SubfontDescriptorObj struct { PtrToSubsetFontObj *SubsetFontObj // contains filtered or unexported fields }
SubfontDescriptorObj pdf subfont descriptorObj object
func (*SubfontDescriptorObj) SetIndexObjPdfDictionary ¶
func (s *SubfontDescriptorObj) SetIndexObjPdfDictionary(index int)
SetIndexObjPdfDictionary set PdfDictionary pointer
func (*SubfontDescriptorObj) SetPtrToSubsetFontObj ¶
func (s *SubfontDescriptorObj) SetPtrToSubsetFontObj(ptr *SubsetFontObj)
SetPtrToSubsetFontObj set SubsetFont pointer
type SubsetFontObj ¶
type SubsetFontObj struct { Family string CharacterToGlyphIndex *MapOfCharacterToGlyphIndex CountOfFont int // contains filtered or unexported fields }
SubsetFontObj pdf subsetFont object
func DeserializeSubsetFont ¶
func DeserializeSubsetFont(b []byte) (*SubsetFontObj, error)
func SubsetFontByReader ¶
func SubsetFontByReader(rd io.Reader) (*SubsetFontObj, error)
func SubsetFontByReaderWithOption ¶
func SubsetFontByReaderWithOption(rd io.Reader, option TtfOption) (*SubsetFontObj, error)
func (*SubsetFontObj) AddChars ¶
func (s *SubsetFontObj) AddChars(txt string) error
AddChars add char to map CharacterToGlyphIndex
func (*SubsetFontObj) CharCodeToGlyphIndex ¶
func (s *SubsetFontObj) CharCodeToGlyphIndex(r rune) (uint, error)
CharCodeToGlyphIndex get glyph index from char code
func (*SubsetFontObj) CharIndex ¶
func (s *SubsetFontObj) CharIndex(r rune) (uint, error)
CharIndex index of char in glyph table
func (*SubsetFontObj) CharWidth ¶
func (s *SubsetFontObj) CharWidth(r rune) (uint, error)
CharWidth with of char
func (*SubsetFontObj) Copy ¶
func (s *SubsetFontObj) Copy() *SubsetFontObj
func (*SubsetFontObj) GetFamily ¶
func (s *SubsetFontObj) GetFamily() string
GetFamily get font family name
func (*SubsetFontObj) GetTTFParser ¶
func (s *SubsetFontObj) GetTTFParser() *core.TTFParser
GetTTFParser get TTFParser
func (*SubsetFontObj) GetTtfFontOption ¶
func (s *SubsetFontObj) GetTtfFontOption() TtfOption
GetTtfFontOption get TtfOption must set before SetTTFByPath
func (*SubsetFontObj) GlyphIndexToPdfWidth ¶
func (s *SubsetFontObj) GlyphIndexToPdfWidth(glyphIndex uint) uint
GlyphIndexToPdfWidth get with from glyphIndex
func (*SubsetFontObj) GobDecode ¶
func (s *SubsetFontObj) GobDecode(buf []byte) error
func (*SubsetFontObj) GobEncode ¶
func (s *SubsetFontObj) GobEncode() ([]byte, error)
func (*SubsetFontObj) KernValueByLeft ¶
func (s *SubsetFontObj) KernValueByLeft(left uint) (bool, *core.KernValue)
KernValueByLeft find kern value from kern table by left
func (*SubsetFontObj) Serialize ¶
func (s *SubsetFontObj) Serialize() ([]byte, error)
func (*SubsetFontObj) SetFamily ¶
func (s *SubsetFontObj) SetFamily(familyname string)
SetFamily set font family name
func (*SubsetFontObj) SetIndexObjCIDFont ¶
func (s *SubsetFontObj) SetIndexObjCIDFont(index int)
SetIndexObjCIDFont set IndexObjCIDFont
func (*SubsetFontObj) SetIndexObjUnicodeMap ¶
func (s *SubsetFontObj) SetIndexObjUnicodeMap(index int)
SetIndexObjUnicodeMap set IndexObjUnicodeMap
func (*SubsetFontObj) SetTTFByPath ¶
func (s *SubsetFontObj) SetTTFByPath(ttfpath string) error
SetTTFByPath set ttf
func (*SubsetFontObj) SetTTFByReader ¶
func (s *SubsetFontObj) SetTTFByReader(rd io.Reader) error
SetTTFByReader set ttf
func (*SubsetFontObj) SetTtfFontOption ¶
func (s *SubsetFontObj) SetTtfFontOption(option TtfOption)
SetTtfFontOption set TtfOption must set before SetTTFByPath
func (*SubsetFontObj) ToTemplateFont ¶
func (s *SubsetFontObj) ToTemplateFont() *TemplateFont
ToTemplateFont turns the subsetFontObject into a Template Font
type Template ¶
type Template interface { ID() string Size() (Point, Rect) Bytes() []byte Images() []*ImageObj Fonts() []*SubsetFontObj Templates() []Template NumPages() int FromPage(int) (Template, error) FromPages() []Template Serialize() ([]byte, error) gob.GobDecoder gob.GobEncoder }
Template is an object that can be written to, then used and re-used any number of times within a document.
func CreateTemplate ¶
CreateTemplate creates a template that is not attached to any document.
func DeserializeTemplate ¶
DeserializeTemplate creaties a template from a previously serialized template
type TemplateFont ¶
type TemplateFont struct {
// contains filtered or unexported fields
}
func NewTemplateFont ¶
func NewTemplateFont(sf *SubsetFontObj) *TemplateFont
func (*TemplateFont) GobDecode ¶
func (t *TemplateFont) GobDecode(buf []byte) error
GobDecode decodes the specified byte buffer into the receiving template.
func (*TemplateFont) GobEncode ¶
func (t *TemplateFont) GobEncode() ([]byte, error)
GobEncode encodes the receiving template into a byte buffer. Use GobDecode to decode the byte buffer back to a template.
type TemplateImage ¶
type TemplateImage struct {
// contains filtered or unexported fields
}
func NewTemplateImage ¶
func NewTemplateImage(img *ImageObj) *TemplateImage
func (*TemplateImage) GobDecode ¶
func (t *TemplateImage) GobDecode(buf []byte) error
GobDecode decodes the specified byte buffer into the receiving template.
func (*TemplateImage) GobEncode ¶
func (t *TemplateImage) GobEncode() ([]byte, error)
GobEncode encodes the receiving template into a byte buffer. Use GobDecode to decode the byte buffer back to a template.
type TemplateObj ¶
type TemplateObj struct {
// contains filtered or unexported fields
}
TemplateObj Template object
func (*TemplateObj) ToTemplate ¶
func (tpl *TemplateObj) ToTemplate() Template
type TextOption ¶ added in v0.1.14
type TextOption struct { CharacterSpacing float64 // character spacing for text WordSpacing float64 // word spacing for text Rise float64 // sub/super scripting of fonts NoFill bool // render the filled text Stroke bool // render the stroke of the text Clip bool // Use Text as a clipping path used in conjuction with fill and stroke to determine render mode }
TextOption Text Rendering Options
func (*TextOption) GetRenderMode ¶ added in v0.1.14
func (c *TextOption) GetRenderMode() int
type TransformMatrix ¶
type TransformMatrix struct {
A, B, C, D, E, F float64
}
TransformMatrix is used for generalized transformations of text, drawings and images.
type UnicodeMap ¶
type UnicodeMap struct { PtrToSubsetFontObj *SubsetFontObj // contains filtered or unexported fields }
UnicodeMap unicode map
func (*UnicodeMap) SetPtrToSubsetFontObj ¶
func (u *UnicodeMap) SetPtrToSubsetFontObj(ptr *SubsetFontObj)
SetPtrToSubsetFontObj set pointer to SubsetFontObj
Source Files ¶
- bezier.go
- buff.go
- buff_write.go
- cache_contact_color.go
- cache_content_arc_to.go
- cache_content_cap_style.go
- cache_content_clip.go
- cache_content_close_path.go
- cache_content_curve.go
- cache_content_curve_to.go
- cache_content_draw_path.go
- cache_content_gray.go
- cache_content_image.go
- cache_content_join_style.go
- cache_content_line.go
- cache_content_line_to.go
- cache_content_line_type.go
- cache_content_line_width.go
- cache_content_oval.go
- cache_content_point.go
- cache_content_rectangle.go
- cache_content_rotate.go
- cache_content_text.go
- cache_content_transform.go
- cache_content_use_template.go
- catalog_obj.go
- cell_option.go
- cid_font_obj.go
- clip.go
- content_obj.go
- current.go
- debug.go
- debug_ch.go
- debug_th.go
- device_rgb_obj.go
- embedfont_obj.go
- encoding_obj.go
- encryption_obj.go
- font_option.go
- fontconverthelper.go
- fontdescriptor_obj.go
- func_kern_override.go
- gofpdf.go
- i_cache_contneter.go
- ifont.go
- image_holder.go
- image_obj.go
- image_obj_parse.go
- img_info.go
- iobj.go
- link_option.go
- list_cache_content.go
- map_of_character_To_glyph_index.go
- margin.go
- page_obj.go
- page_option.go
- page_sizes.go
- pages_obj.go
- parse_points.go
- pdf_dictionary_obj.go
- pdf_info_obj.go
- pdf_objs.go
- pdf_options.go
- pdf_protection.go
- points.go
- procset_obj.go
- rect.go
- smask_obj.go
- strhelper.go
- style.go
- subfont_descriptor_obj.go
- subset_font_obj.go
- template.go
- template_obj.go
- text_option.go
- transform.go
- ttf_option.go
- unicode_map.go
- units.go