Documentation ¶
Index ¶
- Constants
- Variables
- func PDFParse(file io.Reader, outPdf *PDFData) error
- type ContentLineStyle
- type ContentText
- type Contenter
- type FuncKernOverride
- type FuncTextriseOverride
- type PDFData
- type PDFFontData
- type PDFImageData
- type PDFObjData
- type PDFObjPropertiesData
- type PDFObjPropertyData
- type PDFt
- func (i *PDFt) AddFont(name string, ttfpath string) error
- func (i *PDFt) DuplicatePageAfter(targetPageNumber, position int) error
- func (i *PDFt) GetNumberOfPage() int
- func (i *PDFt) Insert(text string, pageNum int, x float64, y float64, w float64, h float64, ...) error
- func (i *PDFt) InsertImg(img []byte, pageNum int, x float64, y float64, w float64, h float64) error
- func (i *PDFt) InsertImgBase64(base64str string, pageNum int, x float64, y float64, w float64, h float64) error
- func (i *PDFt) KernOverride(name string, fn FuncKernOverride) error
- func (i *PDFt) Open(filepath string) error
- func (i *PDFt) OpenFrom(r io.Reader) error
- func (i *PDFt) RemovePage(targetPageNumber int) error
- func (i *PDFt) Save(filepath string) error
- func (i *PDFt) SaveTo(w io.Writer) error
- func (i *PDFt) SetFont(name string, style string, size int) error
- func (i *PDFt) SetProtection(permissions int, userPass []byte, ownerPass []byte) error
- func (i *PDFt) ShowCellBorder(isShow bool)
- func (i *PDFt) TextriseOverride(name string, fn FuncTextriseOverride) error
- type TrailerData
- type XrefData
Constants ¶
const Bold = 2 //000010
Bold - font style bold
const Bottom = gopdf.Bottom //000001
Bottom bottom
const Center = gopdf.Center //010000
Center center
const Italic = 1 //000001
Italic - font style italic
const Left = gopdf.Left //001000
Left left
const Middle = gopdf.Middle //100000
Middle middle
const Regular = 0 //000000
Regular - font style regular
const Right = gopdf.Right //000010
Right right
const Top = gopdf.Top //000100
Top top
const Underline = 4 //000100
Underline - font style underline
Variables ¶
var ErrAddSameFontName = errors.New("add same font name")
ErrAddSameFontName add same font name
var ErrCrawlResultValOfNotFound = errors.New("CrawlResult Val Of Not Found")
ErrCrawlResultValOfNotFound CrawlResult Val Of Not Found
var ErrFontNameNotFound = errors.New("font name not found")
ErrFontNameNotFound font name not found
var ErrWrongTypeOfVal = errors.New("wrong type of val")
ErrWrongTypeOfVal wrong type of val
var ErrorObjectIDNotFound = errors.New("Object ID not found")
ErrorObjectIDNotFound Object ID not found
Functions ¶
Types ¶
type ContentLineStyle ¶
type ContentLineStyle struct {
// contains filtered or unexported fields
}
ContentLineStyle set line width
type ContentText ¶
type ContentText struct {
// contains filtered or unexported fields
}
ContentText text in pdf
type Contenter ¶
type Contenter interface {
// contains filtered or unexported methods
}
Contenter create content stream
type FuncKernOverride ¶
type FuncKernOverride func( leftRune rune, rightRune rune, leftPair uint, rightPair uint, pairVal int16, ) int16
FuncKernOverride return your custome pair value
type FuncTextriseOverride ¶
type FuncTextriseOverride func( leftRune rune, rightRune rune, fontsize int, allText string, currTextIndex int, ) float32
FuncTextriseOverride override text rise
type PDFData ¶
type PDFData struct {
// contains filtered or unexported fields
}
PDFData pdf file data
type PDFFontData ¶
type PDFFontData struct {
// contains filtered or unexported fields
}
PDFFontData font data
func PDFParseFont ¶
func PDFParseFont(path string, name string) (*PDFFontData, error)
PDFParseFont parse font
type PDFImageData ¶
type PDFImageData struct {
// contains filtered or unexported fields
}
PDFImageData pdf img
type PDFObjData ¶
type PDFObjData struct {
// contains filtered or unexported fields
}
PDFObjData byte of obj
type PDFObjPropertiesData ¶
type PDFObjPropertiesData []PDFObjPropertyData
PDFObjPropertiesData array of PDFObjPropertyData
type PDFObjPropertyData ¶
type PDFObjPropertyData struct {
// contains filtered or unexported fields
}
PDFObjPropertyData property of pdf obj
type PDFt ¶
type PDFt struct {
// contains filtered or unexported fields
}
PDFt inject text to pdf
func (*PDFt) DuplicatePageAfter ¶ added in v0.3.0
DuplicatePageAfter ...
func (*PDFt) GetNumberOfPage ¶ added in v0.3.0
GetNumberOfPage get number of page
func (*PDFt) Insert ¶
func (i *PDFt) Insert(text string, pageNum int, x float64, y float64, w float64, h float64, align int) error
Insert insert text in to pdf
func (*PDFt) InsertImgBase64 ¶
func (i *PDFt) InsertImgBase64(base64str string, pageNum int, x float64, y float64, w float64, h float64) error
InsertImgBase64 insert img base 64
func (*PDFt) KernOverride ¶
func (i *PDFt) KernOverride(name string, fn FuncKernOverride) error
KernOverride override kerning
func (*PDFt) RemovePage ¶ added in v0.3.0
RemovePage remove page at targetPageNumber
func (*PDFt) SetProtection ¶
SetProtection set pdf protection
func (*PDFt) ShowCellBorder ¶
ShowCellBorder show cell of border
func (*PDFt) TextriseOverride ¶
func (i *PDFt) TextriseOverride(name string, fn FuncTextriseOverride) error
TextriseOverride override text rise Text rise, Trise , specifies the distance, in unscaled text space units, to move the baseline up or down from its default location. Positive values of text rise move the baseline up. Adjustments to the baseline are useful for drawing superscripts or subscripts. The default location of the baseline can be restored by setting the text rise to 0.
type TrailerData ¶
type TrailerData struct {
// contains filtered or unexported fields
}
TrailerData trailer
Source Files ¶
- content_img_base64.go
- content_line_style.go
- content_text.go
- contenter.go
- crawl.go
- crawl_result.go
- crawl_result_font.go
- crawl_result_x_object.go
- func_textrise_override.go
- pdf_data.go
- pdf_font_data.go
- pdf_image_data.go
- pdf_obj_data.go
- pdf_obj_properties_data.go
- pdf_obj_property_data.go
- pdf_parse.go
- pdf_parse_font.go
- pdft.go
- regex.go
- xref_data.go