Versions in this module Expand all Collapse all v0 v0.9.14 Dec 25, 2020 Changes in this version + const AllBorders + const Bold + const Bottom + const Center + const ContentTypeCell + const ContentTypeText + const Italic + const Left + const Middle + const PermissionsAnnotForms + const PermissionsCopy + const PermissionsModify + const PermissionsPrint + const Regular + const Right + const Top + const Underline + const UnitCM + const UnitIN + const UnitMM + const UnitPT + const UnitUnset + const Unit_CM + const Unit_IN + const Unit_MM + const Unit_PT + const Unit_Unset + var EntrySelectors = []int + var ErrCharNotFound = errors.New("char not found") + var ErrNotSupportShortIndexYet = errors.New("not suport none short index yet") + var PageSize10x14 = &Rect + var PageSizeA0 = &Rect + var PageSizeA1 = &Rect + var PageSizeA2 = &Rect + var PageSizeA3 = &Rect + var PageSizeA4 = &Rect + var PageSizeA4Landscape = &Rect + var PageSizeA4Small = &Rect + var PageSizeA5 = &Rect + var PageSizeB4 = &Rect + var PageSizeB5 = &Rect + var PageSizeExecutive = &Rect + var PageSizeFolio = &Rect + var PageSizeLedger = &Rect + var PageSizeLegal = &Rect + var PageSizeLetter = &Rect + var PageSizeLetterSmall = &Rect + var PageSizeQuarto = &Rect + var PageSizeStatement = &Rect + var PageSizeTabloid = &Rect + func CheckSum(data []byte) uint + func ContentObjCalTextHeight(fontsize int) float64 + func CreateEmbeddedFontSubsetName(name string) string + func DesignUnitsToPdf(val int, unitsPerEm uint) int + func FontConvertHelperCw2Str(cw FontCw) string + func FontConvertHelper_Cw2Str(cw FontCw) string + func GetBuffer() *bytes.Buffer + func ImgReactagleToWH(imageRect image.Rectangle) (float64, float64) + func PointsToUnits(t int, u float64) float64 + func PointsToUnitsVar(t int, u ...*float64) + func PutBuffer(buf *bytes.Buffer) + 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 Box struct + Bottom float64 + Left float64 + Right float64 + Top float64 + func (box *Box) UnitsToPoints(t int) (b *Box) + type Buff struct + func (b *Buff) Bytes() []byte + func (b *Buff) Len() int + func (b *Buff) Position() int + func (b *Buff) SetPosition(pos int) + func (b *Buff) Write(p []byte) (int, error) + type CIDFontObj struct + PtrToSubsetFontObj *SubsetFontObj + func (ci *CIDFontObj) SetIndexObjSubfontDescriptor(index int) + func (ci *CIDFontObj) SetPtrToSubsetFontObj(ptr *SubsetFontObj) + type CacheContent struct + func (c *CacheContent) Setup(rectangle *Rect, textColor Rgb, grayFill float64, fontCountIndex int, ...) + func (c *CacheContent) WriteTextToContent(text string) + type CatalogObj struct + func (c *CatalogObj) SetIndexObjOutlines(index int) + type CellOption struct + Align int + Border int + Float int + type Config struct + K float64 + PageSize Rect + Protection PDFProtectionConfig + TrimBox Box + Unit int + type ContentObj struct + func (c *ContentObj) AppendStreamCurve(x0 float64, y0 float64, x1 float64, y1 float64, x2 float64, y2 float64, ...) + func (c *ContentObj) AppendStreamImage(index int, x float64, y float64, rect *Rect) + func (c *ContentObj) AppendStreamImportedTemplate(tplName string, scaleX float64, scaleY float64, tX float64, tY float64) + func (c *ContentObj) AppendStreamLine(x1 float64, y1 float64, x2 float64, y2 float64) + func (c *ContentObj) AppendStreamOval(x1 float64, y1 float64, x2 float64, y2 float64) + func (c *ContentObj) AppendStreamPolygon(points []Point, style string) + func (c *ContentObj) AppendStreamRectangle(x float64, y float64, wdth float64, hght float64, style string) + func (c *ContentObj) AppendStreamSetColorFill(r uint8, g uint8, b uint8) + func (c *ContentObj) AppendStreamSetColorStroke(r uint8, g uint8, b uint8) + func (c *ContentObj) AppendStreamSetGrayFill(w float64) + func (c *ContentObj) AppendStreamSetGrayStroke(w float64) + func (c *ContentObj) AppendStreamSetLineType(t string) + func (c *ContentObj) AppendStreamSetLineWidth(w float64) + func (c *ContentObj) AppendStreamSubsetFont(rectangle *Rect, text string, cellOpt CellOption) error + func (c *ContentObj) AppendStreamText(text string) error + type Current struct + CountOfFont int + CountOfImg int + CountOfL int + FontFontCount int + FontISubset *SubsetFontObj + FontSize int + FontStyle int + FontType int + ImgCaches []ImageCache + IndexOfFontObj int + IndexOfPageObj int + X float64 + Y float64 + type DeviceRGBObj struct + type EmbedFontObj struct + Data string + func (e *EmbedFontObj) SetFont(font IFont, zfontpath string) + type EncodingObj struct + func (e *EncodingObj) GetFont() IFont + func (e *EncodingObj) SetFont(font IFont) + type EncryptionObj struct + type ExtGS struct + Index int + type ExtGStateObj struct + BM string + CA float64 + type FontCw map[byte]int + type FontDescItem struct + Key string + Val string + type FontDescriptorObj struct + func (f *FontDescriptorObj) GetFont() IFont + func (f *FontDescriptorObj) SetFont(font IFont) + func (f *FontDescriptorObj) SetFontFileObjRelate(relate string) + type FontObj struct + CountOfFont int + Family string + Font IFont + IsEmbedFont bool + func (f *FontObj) SetIndexObjEncoding(index int) + func (f *FontObj) SetIndexObjFontDescriptor(index int) + func (f *FontObj) SetIndexObjWidth(index int) + type FuncKernOverride func(leftRune rune, rightRune rune, leftPair uint, rightPair uint, pairVal int16) int16 + type GoPdf struct + func (gp *GoPdf) AddExternalLink(url string, x, y, w, h float64) + func (gp *GoPdf) AddInternalLink(anchor string, x, y, w, h float64) + func (gp *GoPdf) AddOutline(title string) + func (gp *GoPdf) AddPage() + func (gp *GoPdf) AddPageWithOption(opt PageOption) + func (gp *GoPdf) AddTTFFont(family string, ttfpath string) error + func (gp *GoPdf) AddTTFFontByReader(family string, rd io.Reader) error + func (gp *GoPdf) AddTTFFontByReaderWithOption(family string, rd io.Reader, option TtfOption) error + func (gp *GoPdf) AddTTFFontWithOption(family string, ttfpath string, option TtfOption) error + func (gp *GoPdf) Br(h float64) + func (gp *GoPdf) Cell(rectangle *Rect, text string) error + func (gp *GoPdf) CellWithOption(rectangle *Rect, text string, opt CellOption) error + func (gp *GoPdf) Close() error + func (gp *GoPdf) Curve(x0 float64, y0 float64, x1 float64, y1 float64, x2 float64, y2 float64, ...) + func (gp *GoPdf) GetBytesPdf() []byte + func (gp *GoPdf) GetBytesPdfReturnErr() ([]byte, error) + func (gp *GoPdf) GetNextObjectID() int + func (gp *GoPdf) GetX() float64 + func (gp *GoPdf) GetY() float64 + func (gp *GoPdf) Image(picPath string, x float64, y float64, rect *Rect) error + func (gp *GoPdf) ImageByHolder(img ImageHolder, x float64, y float64, rect *Rect) error + func (gp *GoPdf) ImportObjects(objs map[int]string, startObjID int) + func (gp *GoPdf) ImportPage(sourceFile string, pageno int, box string) int + func (gp *GoPdf) ImportPageStream(sourceStream *io.ReadSeeker, pageno int, box string) int + func (gp *GoPdf) ImportTemplates(tpls map[string]int) + func (gp *GoPdf) IsCurrFontContainGlyph(r rune) (bool, error) + func (gp *GoPdf) KernOverride(family string, fn FuncKernOverride) error + func (gp *GoPdf) Line(x1 float64, y1 float64, x2 float64, y2 float64) + func (gp *GoPdf) MarginBottom() float64 + func (gp *GoPdf) MarginLeft() float64 + func (gp *GoPdf) MarginRight() float64 + func (gp *GoPdf) MarginTop() float64 + func (gp *GoPdf) Margins() (float64, float64, float64, float64) + func (gp *GoPdf) MeasureTextWidth(text string) (float64, error) + func (gp *GoPdf) MultiCell(rectangle *Rect, text string) error + func (gp *GoPdf) Oval(x1 float64, y1 float64, x2 float64, y2 float64) + func (gp *GoPdf) PointsToUnits(u float64) float64 + func (gp *GoPdf) PointsToUnitsVar(u ...*float64) + func (gp *GoPdf) Polygon(points []Point, style string) + func (gp *GoPdf) Read(p []byte) (int, error) + func (gp *GoPdf) RectFromLowerLeft(x float64, y float64, wdth float64, hght float64) + func (gp *GoPdf) RectFromLowerLeftWithStyle(x float64, y float64, wdth float64, hght float64, style string) + func (gp *GoPdf) RectFromUpperLeft(x float64, y float64, wdth float64, hght float64) + func (gp *GoPdf) RectFromUpperLeftWithStyle(x float64, y float64, wdth float64, hght float64, style string) + func (gp *GoPdf) Rotate(angle, x, y float64) + func (gp *GoPdf) RotateReset() + func (gp *GoPdf) SetAlpha(alpha float64, blendModeStr string) error + func (gp *GoPdf) SetAnchor(name string) + func (gp *GoPdf) SetCompressLevel(level int) + func (gp *GoPdf) SetFillColor(r uint8, g uint8, b uint8) + func (gp *GoPdf) SetFont(family string, style string, size int) error + func (gp *GoPdf) SetFontWithStyle(family string, style int, size int) error + func (gp *GoPdf) SetGrayFill(grayScale float64) + func (gp *GoPdf) SetGrayStroke(grayScale float64) + func (gp *GoPdf) SetInfo(info PdfInfo) + func (gp *GoPdf) SetLeftMargin(margin float64) + func (gp *GoPdf) SetLineType(linetype string) + func (gp *GoPdf) SetLineWidth(width float64) + func (gp *GoPdf) SetMarginBottom(margin float64) + func (gp *GoPdf) SetMarginLeft(margin float64) + func (gp *GoPdf) SetMarginRight(margin float64) + func (gp *GoPdf) SetMarginTop(margin float64) + func (gp *GoPdf) SetMargins(left, top, right, bottom float64) + func (gp *GoPdf) SetNoCompression() + func (gp *GoPdf) SetStrokeColor(r uint8, g uint8, b uint8) + func (gp *GoPdf) SetTextColor(r uint8, g uint8, b uint8) + func (gp *GoPdf) SetTopMargin(margin float64) + func (gp *GoPdf) SetX(x float64) + func (gp *GoPdf) SetY(y float64) + func (gp *GoPdf) SplitText(text string, width float64) ([]string, error) + func (gp *GoPdf) Start(config Config) + func (gp *GoPdf) Text(text string) error + func (gp *GoPdf) UnitsToPoints(u float64) float64 + func (gp *GoPdf) UnitsToPointsVar(u ...*float64) + func (gp *GoPdf) UseImportedTemplate(tplid int, x float64, y float64, w float64, h float64) + func (gp *GoPdf) Write(w io.Writer) error + func (gp *GoPdf) WritePdf(pdfPath string) error + type IFont interface + GetCw func() FontCw + GetDesc func() []FontDescItem + GetDiff func() string + GetEnc func() string + GetFamily func() string + GetName func() string + GetOriginalsize func() int + GetType func() string + GetUp func() int + GetUt func() int + Init func() + SetFamily func(family string) + type IObj interface + type ImageCache struct + Index int + Path string + Rect *Rect + type ImageHolder interface + ID func() string + func ImageHolderByBytes(b []byte) (ImageHolder, error) + func ImageHolderByPath(path string) (ImageHolder, error) + func ImageHolderByReader(r io.Reader) (ImageHolder, error) + type ImageObj struct + func (i *ImageObj) GetRect() *Rect + func (i *ImageObj) Parse() error + func (i *ImageObj) SetImage(r io.Reader) error + func (i *ImageObj) SetImagePath(path string) error + type ImportedObj struct + Data string + type MapOfCharacterToGlyphIndex struct + Keys []rune + Vals []uint + func NewMapOfCharacterToGlyphIndex() *MapOfCharacterToGlyphIndex + func (m *MapOfCharacterToGlyphIndex) AllKeys() []rune + func (m *MapOfCharacterToGlyphIndex) AllVals() []uint + 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 struct + Bottom float64 + Left float64 + Right float64 + Top float64 + type OutlineObj struct + type OutlinesObj struct + func (o *OutlinesObj) AddOutline(dest int, title string) + func (o *OutlinesObj) Count() int + func (o *OutlinesObj) SetIndexObjOutlines(index int) + type PDFProtection struct + func (p *PDFProtection) EncryptionObj() *EncryptionObj + func (p *PDFProtection) Objectkey(objID int) []byte + func (p *PDFProtection) SetProtection(permissions int, userPass []byte, ownerPass []byte) error + type PDFProtectionConfig struct + OwnerPass []byte + Permissions int + UseProtection bool + UserPass []byte + type PageObj struct + Contents string + Links []linkOption + ResourcesRelate string + type PageOption struct + PageSize *Rect + TrimBox *Box + type PagesObj struct + Kids string + PageCount int + type PdfDictionaryObj struct + PtrToSubsetFontObj *SubsetFontObj + func (p *PdfDictionaryObj) AddCompositeGlyphs(glyphArray *[]int, glyph int) + func (p *PdfDictionaryObj) GetOffset(glyph int) int + func (p *PdfDictionaryObj) SetPtrToSubsetFontObj(ptr *SubsetFontObj) + type PdfInfo struct + Author string + CreationDate time.Time + Creator string + Producer string + Subject string + Title string + type Point struct + X float64 + Y float64 + type ProcSetObj struct + ExtGStates []ExtGS + ImportedTemplateIds map[string]int + RelateXobjs RelateXobjects + Relates RelateFonts + type Rect struct + H float64 + W float64 + func (rect *Rect) PointsToUnits(t int) (r *Rect) + func (rect *Rect) UnitsToPoints(t int) (r *Rect) + type RelateFont struct + CountOfFont int + Family string + IndexOfObj int + Style int + type RelateFonts []RelateFont + func (re *RelateFonts) IsContainsFamily(family string) bool + func (re *RelateFonts) IsContainsFamilyAndStyle(family string, style int) bool + type RelateXobject struct + IndexOfObj int + type RelateXobjects []RelateXobject + type Rgb struct + func (rgb *Rgb) SetB(b uint8) + func (rgb *Rgb) SetG(g uint8) + func (rgb *Rgb) SetR(r uint8) + type SMask struct + type SubfontDescriptorObj struct + PtrToSubsetFontObj *SubsetFontObj + func (s *SubfontDescriptorObj) SetIndexObjPdfDictionary(index int) + func (s *SubfontDescriptorObj) SetPtrToSubsetFontObj(ptr *SubsetFontObj) + type SubsetFontObj struct + CharacterToGlyphIndex *MapOfCharacterToGlyphIndex + CountOfFont int + Family string + 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) 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) KernValueByLeft(left uint) (bool, *core.KernValue) + 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) + type Transparency struct + IndexOfExtGState int + type TtfOption struct + Style int + UseKerning bool + type UnicodeMap struct + PtrToSubsetFontObj *SubsetFontObj + func (u *UnicodeMap) SetPtrToSubsetFontObj(ptr *SubsetFontObj)