mirror of
https://github.com/fumiama/go-docx.git
synced 2026-06-23 03:50:36 +08:00
add AddInlineDrawingFrom
This commit is contained in:
18
docxlib.go
18
docxlib.go
@@ -18,7 +18,11 @@ type Docx struct {
|
||||
Document Document
|
||||
DocRelation Relationships
|
||||
|
||||
rId uintptr
|
||||
media []Media
|
||||
mediaNameIdx map[string]int
|
||||
|
||||
rId uintptr
|
||||
imageId uintptr
|
||||
|
||||
buf *bytes.Buffer
|
||||
isbufempty bool
|
||||
@@ -93,15 +97,3 @@ func (f *Docx) Read(p []byte) (n int, err error) {
|
||||
f.isbufempty = false
|
||||
return f.buf.Read(p)
|
||||
}
|
||||
|
||||
// Refer gets the url for a reference
|
||||
func (f *Docx) Refer(id string) (href string, err error) {
|
||||
for _, a := range f.DocRelation.Relationships {
|
||||
if a.ID == id {
|
||||
href = a.Target
|
||||
return
|
||||
}
|
||||
}
|
||||
err = ErrRefIDNotFound
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user