Versions in this module Expand all Collapse all v0 v0.4.2 Nov 3, 2020 Changes in this version type CacheContent + func (c *CacheContent) MeasureTextWidth(text string) (float64, error) type ImageObj + func (i *ImageObj) CreateSMask() (*SMask, error) + func (i *ImageObj) SetSMaskObjID(objID int) type SMask + func (s *SMask) BytesBuffer(objID int) (*bytes.Buffer, error) v0.2.0 Aug 28, 2018 Changes in this version + const ARG_1_AND_2_ARE_WORDS + const Bold + const Bottom + const Center + const ContentTypeCell + const ContentTypeText + const Italic + const Left + const MORE_COMPONENTS + const Middle + const PermissionsAnnotForms + const PermissionsCopy + const PermissionsModify + const PermissionsPrint + const Regular + const Right + const Top + const Underline + const WE_HAVE_AN_X_AND_Y_SCALE + const WE_HAVE_A_SCALE + const WE_HAVE_A_TWO_BY_TWO + var EntrySelectors = []int + var ErrCharNotFound = errors.New("char not found") + var ErrNotSupportShortIndexYet = errors.New("not suport none short index yet") + func CheckSum(data []byte) uint + func Chr(n int) byte + func ContentObj_CalTextHeight(fontsize int) float64 + func CreateEmbeddedFontSubsetName(name string) string + func DebugSubType(b []byte) + func DesignUnitsToPdf(val int, unitsPerEm uint) int + func FontConvertHelper_Cw2Str(cw FontCw) string + func ImgReactagleToWH(imageRect image.Rectangle) (float64, 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 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 BasicObj struct + Data string + 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) Build(objID int) error + func (ci *CIDFontObj) GetObjBuff() *bytes.Buffer + 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) ToStream(protection *PDFProtection) (*bytes.Buffer, error) + func (c *CacheContent) WriteTextToContent(text string) + type CatalogObj struct + type CellOption struct + Align int + Border int + Float int + type Config struct + K float64 + PageSize Rect + Protection PDFProtectionConfig + Unit string + 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) AppendStreamLine(x1 float64, y1 float64, x2 float64, y2 float64) + func (c *ContentObj) AppendStreamOval(x1 float64, y1 float64, x2 float64, y2 float64) + 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 + Font_FontCount int + Font_ISubset *SubsetFontObj + Font_Size int + Font_Style int + Font_Type 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 + func (e *EncryptionObj) Build(objID int) error + func (e *EncryptionObj) GetObjBuff() *bytes.Buffer + 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 FuncTextriseOverride func(leftRune rune, rightRune rune, fontsize int, allText string, currTextIndex int) float32 + type GoPdf struct + 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) 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) KernOverride(family string, fn FuncKernOverride) error + func (gp *GoPdf) Line(x1 float64, y1 float64, x2 float64, y2 float64) + func (gp *GoPdf) MeasureTextWidth(text string) (float64, error) + func (gp *GoPdf) Oval(x1 float64, y1 float64, x2 float64, y2 float64) + 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) 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) 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) Start(config Config) + func (gp *GoPdf) Text(text string) error + func (gp *GoPdf) WritePdf(pdfPath string) + 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) Build(objID int) error + func (i *ImageObj) GetObjBuff() *bytes.Buffer + 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 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 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 + ResourcesRelate string + type PageOption struct + PageSize Rect + type PagesObj struct + Kids string + PageCount int + type PdfDictionaryObj struct + PtrToSubsetFontObj *SubsetFontObj + func (p *PdfDictionaryObj) AddCompositeGlyphs(glyphArray *[]int, glyph int) + func (p *PdfDictionaryObj) Build(objID int) error + func (p *PdfDictionaryObj) GetObjBuff() *bytes.Buffer + 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 ProcSetObj struct + RealteXobjs RealteXobjects + Realtes RelateFonts + type RealteXobject struct + IndexOfObj int + type RealteXobjects []RealteXobject + type Rect struct + H float64 + W float64 + 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 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) Build(objID int) error + func (s *SubfontDescriptorObj) GetObjBuff() *bytes.Buffer + 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) Build(objID int) 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) GetObjBuff() *bytes.Buffer + 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) SetFuncKernOverride(funcKernOverride FuncKernOverride) + func (s *SubsetFontObj) SetFuncTextriseOverride(funcTextriseOverride FuncTextriseOverride) + 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 TtfOption struct + Style int + UseKerning bool + type UnicodeMap struct + PtrToSubsetFontObj *SubsetFontObj + func (u *UnicodeMap) Build(objID int) error + func (u *UnicodeMap) GetObjBuff() *bytes.Buffer + func (u *UnicodeMap) SetPtrToSubsetFontObj(ptr *SubsetFontObj)