feat(文档导出): 支持指定页导出,统一文件编号
build.yaml / build (push) Successful in 39s

This commit is contained in:
xiaoqidun committed 2026-09-14 12:11:53 +08:00
1 parent d3904521b9
commit 3e87048a30
8 files changed
+336 -32

No files matched your search

+3 -1
View File
@@ -146,6 +146,7 @@ func (n *pdfNavigation) addAction(page int, rect canvas.Rect, action Action, boo
// 入参: outlines 大纲节点, level 节点层级, bookmarks 书签, pageIndex 页面索引表, pages 页面数据
func (n *pdfNavigation) addOutlines(outlines []OutlineElem, level int, bookmarks map[string]Dest, pageIndex map[string]int, pages []pdfPage) {
for _, outline := range outlines {
nextLevel := level
if dest := outlineDest(outline, bookmarks); dest != nil {
if page, ok := pageIndex[dest.PageID]; ok {
n.Outline[page] = append(n.Outline[page], pdfOutline{
@@ -153,9 +154,10 @@ func (n *pdfNavigation) addOutlines(outlines []OutlineElem, level int, bookmarks
Level: level,
Y: pdfDestY(*dest, pages[page].Box.H),
})
nextLevel++
}
}
n.addOutlines(outline.OutlineElem, level+1, bookmarks, pageIndex, pages)
n.addOutlines(outline.OutlineElem, nextLevel, bookmarks, pageIndex, pages)
}
}