Versions in this module Expand all Collapse all v1 v1.2.0 Aug 8, 2023 v1.1.0 Aug 8, 2023 Changes in this version + var ErrInvalidOperand = errors.New("invalid operand") + type ContentCreator struct + func NewContentCreator() *ContentCreator + func (cc *ContentCreator) AddOperand(op ContentStreamOperation) *ContentCreator + func (cc *ContentCreator) Add_B() *ContentCreator + func (cc *ContentCreator) Add_BMC(tag core.PdfObjectName) *ContentCreator + func (cc *ContentCreator) Add_BT() *ContentCreator + func (cc *ContentCreator) Add_B_starred() *ContentCreator + func (cc *ContentCreator) Add_CS(name core.PdfObjectName) *ContentCreator + func (cc *ContentCreator) Add_Do(name core.PdfObjectName) *ContentCreator + func (cc *ContentCreator) Add_EMC() *ContentCreator + func (cc *ContentCreator) Add_ET() *ContentCreator + func (cc *ContentCreator) Add_G(gray float64) *ContentCreator + func (cc *ContentCreator) Add_J(lineCapStyle string) *ContentCreator + func (cc *ContentCreator) Add_K(c, m, y, k float64) *ContentCreator + func (cc *ContentCreator) Add_M(miterlimit float64) *ContentCreator + func (cc *ContentCreator) Add_Q() *ContentCreator + func (cc *ContentCreator) Add_RG(r, g, b float64) *ContentCreator + func (cc *ContentCreator) Add_S() *ContentCreator + func (cc *ContentCreator) Add_SC(c ...float64) *ContentCreator + func (cc *ContentCreator) Add_SCN(c ...float64) *ContentCreator + func (cc *ContentCreator) Add_SCN_pattern(name core.PdfObjectName, c ...float64) *ContentCreator + func (cc *ContentCreator) Add_TD(tx, ty float64) *ContentCreator + func (cc *ContentCreator) Add_TJ(vals ...core.PdfObject) *ContentCreator + func (cc *ContentCreator) Add_TL(leading float64) *ContentCreator + func (cc *ContentCreator) Add_Tc(charSpace float64) *ContentCreator + func (cc *ContentCreator) Add_Td(tx, ty float64) *ContentCreator + func (cc *ContentCreator) Add_Tf(fontName core.PdfObjectName, fontSize float64) *ContentCreator + func (cc *ContentCreator) Add_Tj(textstr core.PdfObjectString) *ContentCreator + func (cc *ContentCreator) Add_Tm(a, b, c, d, e, f float64) *ContentCreator + func (cc *ContentCreator) Add_Tr(render int64) *ContentCreator + func (cc *ContentCreator) Add_Ts(rise float64) *ContentCreator + func (cc *ContentCreator) Add_Tstar() *ContentCreator + func (cc *ContentCreator) Add_Tw(wordSpace float64) *ContentCreator + func (cc *ContentCreator) Add_Tz(scale float64) *ContentCreator + func (cc *ContentCreator) Add_W() *ContentCreator + func (cc *ContentCreator) Add_W_starred() *ContentCreator + func (cc *ContentCreator) Add_b() *ContentCreator + func (cc *ContentCreator) Add_b_starred() *ContentCreator + func (cc *ContentCreator) Add_c(x1, y1, x2, y2, x3, y3 float64) *ContentCreator + func (cc *ContentCreator) Add_cm(a, b, c, d, e, f float64) *ContentCreator + func (cc *ContentCreator) Add_cs(name core.PdfObjectName) *ContentCreator + func (cc *ContentCreator) Add_d(dashArray []int64, dashPhase int64) *ContentCreator + func (cc *ContentCreator) Add_f() *ContentCreator + func (cc *ContentCreator) Add_f_starred() *ContentCreator + func (cc *ContentCreator) Add_g(gray float64) *ContentCreator + func (cc *ContentCreator) Add_gs(dictName core.PdfObjectName) *ContentCreator + func (cc *ContentCreator) Add_h() *ContentCreator + func (cc *ContentCreator) Add_i(flatness float64) *ContentCreator + func (cc *ContentCreator) Add_j(lineJoinStyle string) *ContentCreator + func (cc *ContentCreator) Add_k(c, m, y, k float64) *ContentCreator + func (cc *ContentCreator) Add_l(x, y float64) *ContentCreator + func (cc *ContentCreator) Add_m(x, y float64) *ContentCreator + func (cc *ContentCreator) Add_n() *ContentCreator + func (cc *ContentCreator) Add_q() *ContentCreator + func (cc *ContentCreator) Add_quote(textstr core.PdfObjectString) *ContentCreator + func (cc *ContentCreator) Add_quotes(textstr core.PdfObjectString, aw, ac float64) *ContentCreator + func (cc *ContentCreator) Add_re(x, y, width, height float64) *ContentCreator + func (cc *ContentCreator) Add_rg(r, g, b float64) *ContentCreator + func (cc *ContentCreator) Add_ri(intent core.PdfObjectName) *ContentCreator + func (cc *ContentCreator) Add_s() *ContentCreator + func (cc *ContentCreator) Add_scn(c ...float64) *ContentCreator + func (cc *ContentCreator) Add_scn_pattern(name core.PdfObjectName, c ...float64) *ContentCreator + func (cc *ContentCreator) Add_sh(name core.PdfObjectName) *ContentCreator + func (cc *ContentCreator) Add_v(x2, y2, x3, y3 float64) *ContentCreator + func (cc *ContentCreator) Add_w(lineWidth float64) *ContentCreator + func (cc *ContentCreator) Add_y(x1, y1, x3, y3 float64) *ContentCreator + func (cc *ContentCreator) Bytes() []byte + func (cc *ContentCreator) Operations() *ContentStreamOperations + func (cc *ContentCreator) RotateDeg(angle float64) *ContentCreator + func (cc *ContentCreator) Scale(sx, sy float64) *ContentCreator + func (cc *ContentCreator) SetNonStrokingColor(color model.PdfColor) *ContentCreator + func (cc *ContentCreator) SetStrokingColor(color model.PdfColor) *ContentCreator + func (cc *ContentCreator) String() string + func (cc *ContentCreator) Translate(tx, ty float64) *ContentCreator + func (cc *ContentCreator) Wrap() + type ContentStreamInlineImage struct + BitsPerComponent core.PdfObject + ColorSpace core.PdfObject + Decode core.PdfObject + DecodeParms core.PdfObject + Filter core.PdfObject + Height core.PdfObject + ImageMask core.PdfObject + Intent core.PdfObject + Interpolate core.PdfObject + Width core.PdfObject + func NewInlineImageFromImage(img model.Image, encoder core.StreamEncoder) (*ContentStreamInlineImage, error) + func (img *ContentStreamInlineImage) GetColorSpace(resources *model.PdfPageResources) (model.PdfColorspace, error) + func (img *ContentStreamInlineImage) GetEncoder() (core.StreamEncoder, error) + func (img *ContentStreamInlineImage) IsMask() (bool, error) + func (img *ContentStreamInlineImage) String() string + func (img *ContentStreamInlineImage) ToImage(resources *model.PdfPageResources) (*model.Image, error) + func (img *ContentStreamInlineImage) WriteString() string + type ContentStreamOperation struct + Operand string + Params []core.PdfObject + type ContentStreamOperations []*ContentStreamOperation + func (ops *ContentStreamOperations) Bytes() []byte + func (ops *ContentStreamOperations) String() string + func (ops *ContentStreamOperations) WrapIfNeeded() *ContentStreamOperations + type ContentStreamParser struct + func NewContentStreamParser(contentStr string) *ContentStreamParser + func (csp *ContentStreamParser) ExtractText() (string, error) + func (csp *ContentStreamParser) Parse() (*ContentStreamOperations, error) + func (csp *ContentStreamParser) ParseInlineImage() (*ContentStreamInlineImage, error) + type ContentStreamProcessor struct + func NewContentStreamProcessor(ops []*ContentStreamOperation) *ContentStreamProcessor + func (proc *ContentStreamProcessor) AddHandler(condition HandlerConditionEnum, operand string, handler HandlerFunc) + func (proc *ContentStreamProcessor) Process(resources *model.PdfPageResources) error + type GraphicStateStack []GraphicsState + func (gsStack *GraphicStateStack) Pop() GraphicsState + func (gsStack *GraphicStateStack) Push(gs GraphicsState) + type GraphicsState struct + CTM transform.Matrix + ColorNonStroking model.PdfColor + ColorStroking model.PdfColor + ColorspaceNonStroking model.PdfColorspace + ColorspaceStroking model.PdfColorspace + func (gs *GraphicsState) Transform(x, y float64) (float64, float64) + type HandlerConditionEnum int + const HandlerConditionEnumAllOperands + const HandlerConditionEnumOperand + func (hce HandlerConditionEnum) All() bool + func (hce HandlerConditionEnum) Operand() bool + type HandlerFunc func(op *ContentStreamOperation, gs GraphicsState, ...) error