mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 13:56:32 +08:00
This commit is contained in:
1 parent
0ad34ee2b1
commit
0ad2bda1f7
47 files changed
+2849
-522
No files matched your search
@@ -42,13 +42,6 @@ func (n *pdfNavigation) addActions(renderer *Renderer, page int, source actionSo
|
||||
if action.Event != "CLICK" {
|
||||
continue
|
||||
}
|
||||
value, err := pdfNavigationTarget(action, bookmarks, pageIndex, pages)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if value == nil {
|
||||
continue
|
||||
}
|
||||
box, outline, err := renderer.actionLinkRegion(source, action)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -56,6 +49,13 @@ func (n *pdfNavigation) addActions(renderer *Renderer, page int, source actionSo
|
||||
if box.W <= 0 || box.H <= 0 {
|
||||
continue
|
||||
}
|
||||
value, err := n.actionTarget(action, page, source, bookmarks, pageIndex, pages)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if value == nil {
|
||||
continue
|
||||
}
|
||||
path := geometryRectangle(box)
|
||||
if outline != "" {
|
||||
parsed, err := canvas.ParseSVGPath(outline)
|
||||
@@ -99,7 +99,7 @@ func (n *pdfNavigation) addActions(renderer *Renderer, page int, source actionSo
|
||||
continue
|
||||
}
|
||||
n.Link[page] = append(n.Link[page], pdfLink{Rect: pdfSourceRect(box, pages[page].Box.H), Region: region, Actions: area.Actions})
|
||||
n.exactLinks = true
|
||||
n.nativeWrite = true
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -203,7 +203,11 @@ func combinePDFActionRegion(ctx context.Context, geometry GeometryBackend, left,
|
||||
func pdfNavigationValues(actions []pdfNavigationAction, pages []pdfgo.Reference) []pdfgo.NavigationAction {
|
||||
values := make([]pdfgo.NavigationAction, 0, len(actions))
|
||||
for _, action := range actions {
|
||||
value := pdfgo.NavigationAction{URI: action.URI}
|
||||
if action.Movie != nil {
|
||||
values = append(values, action.Movie.values()...)
|
||||
continue
|
||||
}
|
||||
value := pdfgo.NavigationAction{URI: action.URI, Attachment: action.Attachment, Sound: action.Sound}
|
||||
if action.Target != nil {
|
||||
dest := action.Target.Destination
|
||||
dest.Page = pages[action.Target.Page]
|
||||
|
||||
Reference in new issue
Block a user