illustrator

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ClipGroupId = "<Clip Group>"

Variables

This section is empty.

Functions

This section is empty.

Types

type AILayer

type AILayer struct {
	// contains filtered or unexported fields
}

AI Layer Structure

type CompressHandle

type CompressHandle interface {
	Decompress() ([]byte, error)

	Write(stream []byte) (n int, err error)
}

type Drawer

type Drawer interface {
	SetState(state uint8, set bool)
	SetBoundingBox(lx, ly, ux, uy float64)
	// Layer
	BeginLayer(args []string) // Lb
	SetLayerName(name string) // Ln
	SetLayerLock(lock string) // A
	EndLayer()                // LB

	// Paths
	MoveTo(args []string)             // moveto
	LineTo(args []string)             // lineto
	CurveTo(op string, args []string) // curveto

	Fill()
	Stroke()
	FillStroke()
	NorFillStroke()

	ClosePath()                 // closepath
	SetLineCap(arg string)      // set line cap
	SetLineJoin(arg string)     // set line join
	SetLineWidth(width string)  // set linewidth
	SetMiterLimit(limit string) // setmiterlimit

	BeginCompoundPath() // *u
	EndCompoundPath()   // *U

	// Clip Path
	BeginGroupMask() // mark the begining of a mask(clip path) in a sequence of grouped objects
	EndGroupMask()   // mark the end of a sequence of elements containing a  mask.
	DrawClipPath()   // establishing a mask, neither fills nor strokes the current path
	MarkClipPath()   // establishing a mask

	// Color
	SetOpacity(op string, args []string)   // setopacity
	SetRGBColor(op string, args []string)  // setrgbcolor
	SetCMYKColor(op string, args []string) // setcmykcolor

	// Group
	Group()                      // u
	EndGroup()                   // U
	SetGroupStyle(args []string) // U
}

type DrawerStat

type DrawerStat = uint8
const (
	ST_Layer        DrawerStat = iota // 0, Lb-LB
	ST_CompoundPath                   // 1, *u-*U, 复合路径
)

type PathBuilder

type PathBuilder struct {
	strings.Builder
	// contains filtered or unexported fields
}

func (*PathBuilder) ClosePath

func (p *PathBuilder) ClosePath()

func (*PathBuilder) Reset

func (p *PathBuilder) Reset()

type PdfObjectNameSlice

type PdfObjectNameSlice []core.PdfObjectName

func (PdfObjectNameSlice) Len

func (x PdfObjectNameSlice) Len() int

func (PdfObjectNameSlice) Less

func (x PdfObjectNameSlice) Less(i, j int) bool

func (PdfObjectNameSlice) Swap

func (x PdfObjectNameSlice) Swap(i, j int)

type Postscript

type Postscript struct {
	*bufio.Scanner
	// contains filtered or unexported fields
}

func NewPostscript

func NewPostscript(rd io.Reader, drawer Drawer) *Postscript

func (*Postscript) Interpret

func (p *Postscript) Interpret() error

func (*Postscript) SetBoundingBox

func (p *Postscript) SetBoundingBox(line string)

type Reader

type Reader struct {
	*model.PdfReader
	// contains filtered or unexported fields
}

func NewFileReader

func NewFileReader(inputPath string) (*Reader, error)

func NewReader

func NewReader(r io.ReadSeeker) (*Reader, error)

func (*Reader) AsSvg

func (r *Reader) AsSvg() error

func (*Reader) GetAIPrivateData

func (r *Reader) GetAIPrivateData() ([]byte, error)

func (*Reader) GetAiMetaData

func (r *Reader) GetAiMetaData() *core.PdfObjectStream

func (*Reader) GetIllustrator

func (r *Reader) GetIllustrator() *core.PdfIndirectObject

type SVG

type SVG struct {
	// contains filtered or unexported fields
}

func NewSVG

func NewSVG() *SVG

func (*SVG) BeginCompoundPath

func (svg *SVG) BeginCompoundPath()

func (*SVG) BeginGroupMask

func (svg *SVG) BeginGroupMask()

func (*SVG) BeginLayer

func (svg *SVG) BeginLayer(args []string)

func (*SVG) ClosePath

func (svg *SVG) ClosePath()

func (*SVG) CurveTo

func (svg *SVG) CurveTo(op string, args []string)

func (*SVG) DrawClipPath

func (svg *SVG) DrawClipPath()

func (*SVG) EndCompoundPath

func (svg *SVG) EndCompoundPath()

func (*SVG) EndGroup

func (svg *SVG) EndGroup()

func (*SVG) EndGroupMask

func (svg *SVG) EndGroupMask()

func (*SVG) EndLayer

func (svg *SVG) EndLayer()

func (*SVG) Fill

func (svg *SVG) Fill()

func (*SVG) FillStroke

func (svg *SVG) FillStroke()

func (*SVG) Group

func (svg *SVG) Group()

func (*SVG) LineTo

func (svg *SVG) LineTo(args []string)

func (*SVG) MarkClipPath

func (svg *SVG) MarkClipPath()

func (*SVG) MoveTo

func (svg *SVG) MoveTo(args []string)

func (*SVG) NorFillStroke

func (svg *SVG) NorFillStroke()

func (*SVG) Save

func (svg *SVG) Save(path string) error

func (*SVG) SetBoundingBox

func (svg *SVG) SetBoundingBox(lx, ly, ux, uy float64)

func (*SVG) SetCMYKColor

func (svg *SVG) SetCMYKColor(op string, args []string)

func (*SVG) SetGroupStyle

func (svg *SVG) SetGroupStyle(args []string)

func (*SVG) SetLayerLock

func (svg *SVG) SetLayerLock(locked string)

func (*SVG) SetLayerName

func (svg *SVG) SetLayerName(name string)

func (*SVG) SetLineCap

func (svg *SVG) SetLineCap(arg string)

func (*SVG) SetLineJoin

func (svg *SVG) SetLineJoin(arg string)

func (*SVG) SetLineWidth

func (svg *SVG) SetLineWidth(width string)

func (*SVG) SetMiterLimit

func (svg *SVG) SetMiterLimit(limit string)

func (*SVG) SetOpacity

func (svg *SVG) SetOpacity(op string, args []string)

func (*SVG) SetRGBColor

func (svg *SVG) SetRGBColor(op string, args []string)

func (*SVG) SetSize

func (svg *SVG) SetSize(w, h int)

func (*SVG) SetState

func (svg *SVG) SetState(s uint8, set bool)

func (*SVG) Stroke

func (svg *SVG) Stroke()

type SvgGroup

type SvgGroup struct {
	// contains filtered or unexported fields
}

func (*SvgGroup) Attrs

func (g *SvgGroup) Attrs() string

func (*SvgGroup) SetAttr

func (g *SvgGroup) SetAttr(key, val string)

func (*SvgGroup) SetId

func (g *SvgGroup) SetId(id string)

type SvgNode

type SvgNode interface {
	SetId(id string)
	SetAttr(key, val string)
}

type SvgPath

type SvgPath struct {
	// contains filtered or unexported fields
}

func (*SvgPath) Attrs

func (path *SvgPath) Attrs() string

func (*SvgPath) GetAttr

func (path *SvgPath) GetAttr(key string) string

func (*SvgPath) Id

func (path *SvgPath) Id() string

func (*SvgPath) SetAttr

func (path *SvgPath) SetAttr(key, val string)

func (*SvgPath) SetId

func (path *SvgPath) SetId(id string)

type SvgStyle

type SvgStyle map[string]string

func (SvgStyle) Fill

func (style SvgStyle) Fill() string

func (SvgStyle) Stroke

func (style SvgStyle) Stroke() string

func (SvgStyle) Styles

func (style SvgStyle) Styles() string

type ZStdCompress

type ZStdCompress struct {
	// contains filtered or unexported fields
}

ZStdCompress

func (*ZStdCompress) Decompress

func (c *ZStdCompress) Decompress() ([]byte, error)

func (*ZStdCompress) Write

func (c *ZStdCompress) Write(stream []byte) (int, error)

type ZlibCompress

type ZlibCompress struct {
	// contains filtered or unexported fields
}

func (*ZlibCompress) Decompress

func (c *ZlibCompress) Decompress() ([]byte, error)

func (*ZlibCompress) Write

func (c *ZlibCompress) Write(stream []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL