mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 15:06:46 +08:00
This commit is contained in:
1 parent
90bc7b93dc
commit
c2899deff1
7 files changed
+238
-17
No files matched your search
@@ -127,9 +127,13 @@ type DocumentInfo struct {
|
||||
Fonts []FontInfo `json:"fonts"`
|
||||
Signatures []SignatureInfo `json:"signatures"`
|
||||
Pages []PageInfo `json:"pages"`
|
||||
Outlines []OutlineInfo `json:"outlines,omitempty"`
|
||||
DetailsPending bool `json:"detailsPending,omitempty"`
|
||||
}
|
||||
|
||||
// OutlineInfo 目录节点信息
|
||||
type OutlineInfo = ofdgo.OutlineInfo
|
||||
|
||||
// PageInfo 页面信息
|
||||
type PageInfo struct {
|
||||
Index int `json:"index"`
|
||||
@@ -257,6 +261,7 @@ func (s *Session) Summary() DocumentInfo {
|
||||
DocType: s.Reader.DocType(),
|
||||
PageCount: len(s.doc.Pages.Page),
|
||||
Pages: make([]PageInfo, 0, len(s.doc.Pages.Page)),
|
||||
Outlines: s.doc.OutlineInfos(),
|
||||
DetailsPending: true,
|
||||
}
|
||||
if docInfo, err := s.Reader.DocInfo(); err == nil && docInfo != nil {
|
||||
@@ -300,6 +305,7 @@ func (s *Session) Info() DocumentInfo {
|
||||
DocType: s.Reader.DocType(),
|
||||
PageCount: len(s.doc.Pages.Page),
|
||||
Pages: make([]PageInfo, 0, len(s.doc.Pages.Page)),
|
||||
Outlines: s.doc.OutlineInfos(),
|
||||
}
|
||||
if signatures, err := s.signatureInfos(); err == nil {
|
||||
info.Signatures = signatures
|
||||
|
||||
Reference in new issue
Block a user