mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 01:27:26 +08:00
This commit is contained in:
1 parent
6f6fe27891
commit
61917cafce
10 files changed
+472
-161
No files matched your search
@@ -95,16 +95,20 @@ func newPDFNavigation(renderer *Renderer, doc *Document, pages []pdfPage) *pdfNa
|
||||
}
|
||||
}
|
||||
for i, page := range pages {
|
||||
sources := pageActionSources(page.Content, page.Box)
|
||||
sources := renderer.pageActionSources(page.Content, page.Box)
|
||||
if renderer.RenderAnnotations {
|
||||
sources = append(sources, annotationActionSources(renderer.Reader.Annots[page.Content.ID])...)
|
||||
sources = append(sources, renderer.annotationActionSources(renderer.Reader.Annots[page.Content.ID])...)
|
||||
}
|
||||
for _, source := range sources {
|
||||
rect := pdfSourceRect(source.Box, page.Box.H)
|
||||
for _, action := range source.Actions {
|
||||
if action.Event != "CLICK" {
|
||||
continue
|
||||
}
|
||||
box, _ := actionLinkRegion(source, action)
|
||||
if box.W <= 0 || box.H <= 0 {
|
||||
continue
|
||||
}
|
||||
rect := pdfSourceRect(box, page.Box.H)
|
||||
navigation.addAction(i, rect, action, bookmarks, pageIndex, pages)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user