1
0
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:
源文雨
2023-02-20 22:48:04 +08:00
parent f07b5dd914
commit 292a298c57
27 changed files with 634 additions and 130 deletions

View File

@@ -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
}