Versions in this module Expand all Collapse all v0 v0.2.2 Nov 22, 2026 v0.2.1 Nov 18, 2026 v0.2.0 Nov 17, 2026 v0.1.9 Nov 14, 2026 Changes in this version + var ErrClosed = errors.New("阅读会话已经关闭") + var ErrStaleDocument = errors.New("文档已关闭或已切换") + type AnnotationReport struct + Items []reader.AnnotationInfo + Scanned int + Truncated bool + type OpenResult struct + PagePrefix string + Pages []reader.PageInfo + Permissions []reader.DocumentPermissions + type Options struct + MaxConcurrentRenders int + Reader reader.OpenOptions + type PageHandler struct + func NewPageHandler(session *Session) (*PageHandler, error) + func (h *PageHandler) Prefix() string + func (h *PageHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + type PlaybackPreview struct + Data []byte + MIME string + type Service struct + func (s *Service) Annotations(ctx context.Context, prefix string) (AnnotationReport, error) + func (s *Service) AnnotationsForPage(ctx context.Context, prefix string, index int) ([]reader.AnnotationInfo, error) + func (s *Service) AttachmentData(ctx context.Context, prefix string, scope int, id string) ([]byte, error) + func (s *Service) AttachmentImagePreview(ctx context.Context, prefix string, scope int, id string) (preview.Image, error) + func (s *Service) AttachmentPlayback(ctx context.Context, prefix string, scope int, id string) (PlaybackPreview, error) + func (s *Service) AttachmentTextPreview(ctx context.Context, prefix string, scope int, id string) (string, error) + func (s *Service) Attachments(ctx context.Context, prefix string) ([]reader.AttachmentInfo, error) + func (s *Service) CheckDocumentPermission(prefix string, scope int, action reader.PermissionAction) error + func (s *Service) CheckPermission(prefix string, action reader.PermissionAction, indices []int) error + func (s *Service) Close() error + func (s *Service) CloseCurrent(prefix string) error + func (s *Service) CustomTags(ctx context.Context, prefix string) ([]reader.CustomTagTree, error) + func (s *Service) FontList(prefix string) ([]reader.FontInfo, error) + func (s *Service) FontUsage(ctx context.Context, prefix string, ref reader.FontRef, ...) (reader.FontUsage, error) + func (s *Service) FontUsageAll(ctx context.Context, prefix string, options reader.FontUsageOptions) (reader.FontUsageReport, error) + func (s *Service) Info(prefix string) (reader.DocumentInfo, []reader.DocumentPermissions, error) + func (s *Service) Layers(ctx context.Context, prefix string, index int) ([]reader.LayerInfo, error) + func (s *Service) Media(ctx context.Context, prefix string) ([]reader.MediaInfo, error) + func (s *Service) MediaExportData(ctx context.Context, prefix string, scope int, id uint64) ([]byte, error) + func (s *Service) MediaImagePreview(ctx context.Context, prefix string, scope int, id uint64) (preview.Image, error) + func (s *Service) MediaPlayback(ctx context.Context, prefix string, scope int, id, templateID uint64) (PlaybackPreview, error) + func (s *Service) MediaThumbnail(ctx context.Context, prefix string, scope int, id uint64) (preview.Thumbnail, error) + func (s *Service) Open(input any, options Options) (OpenResult, error) + func (s *Service) Outline(prefix string) (reader.OutlineTree, error) + func (s *Service) Page(prefix string, index int) (reader.PageInfo, error) + func (s *Service) PageLinksForPage(ctx context.Context, prefix string, index int) ([]reader.PageLink, error) + func (s *Service) Permissions(prefix string) ([]reader.DocumentPermissions, error) + func (s *Service) Preferences(prefix string) (reader.ViewPreferences, error) + func (s *Service) RenderPDF(ctx context.Context, prefix string, output io.Writer, indices []int, ...) error + func (s *Service) RenderPage(ctx context.Context, prefix string, output io.Writer, index int, ...) error + func (s *Service) Search(ctx context.Context, prefix, query string, options reader.SearchOptions) (reader.SearchReport, error) + func (s *Service) SelectVersion(prefix string, scope int, id string) (OpenResult, error) + func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *Service) SetHiddenLayers(prefix string, index int, ids []string) error + func (s *Service) SignatureCertificate(ctx context.Context, prefix string, scope int, id, slot string) ([]byte, error) + func (s *Service) SignatureDetails(ctx context.Context, prefix string) ([]reader.SignatureInfo, error) + func (s *Service) SignatureSealPreview(ctx context.Context, prefix string, scope int, id string, stampIndex int) (preview.Image, error) + func (s *Service) SignatureSealThumbnail(ctx context.Context, prefix string, scope int, id string, index int) (preview.Thumbnail, error) + func (s *Service) SignatureSummaries(ctx context.Context, prefix string) ([]SignatureSummary, error) + func (s *Service) SignatureValue(ctx context.Context, prefix string, scope int, id string) ([]byte, error) + func (s *Service) Stats(prefix string) (reader.DocumentStats, error) + func (s *Service) Text(prefix string, index int) ([]reader.TextRun, error) + func (s *Service) Versions(ctx context.Context, prefix string) ([]reader.VersionInfo, error) + type Session struct + func Open(input any, options Options) (*Session, error) + func (s *Session) Annotations(ctx context.Context) (AnnotationReport, error) + func (s *Session) AnnotationsForPage(ctx context.Context, index int) ([]reader.AnnotationInfo, error) + func (s *Session) AttachmentData(ctx context.Context, scope int, id string) ([]byte, error) + func (s *Session) AttachmentTextPreview(ctx context.Context, scope int, id string) (string, error) + func (s *Session) Attachments(ctx context.Context) ([]reader.AttachmentInfo, error) + func (s *Session) CheckPermission(action reader.PermissionAction, indices []int) error + func (s *Session) Close() error + func (s *Session) CustomTags(ctx context.Context) ([]reader.CustomTagTree, error) + func (s *Session) FontList() ([]reader.FontInfo, error) + func (s *Session) FontUsage(ctx context.Context, ref reader.FontRef, options reader.FontUsageOptions) (reader.FontUsage, error) + func (s *Session) FontUsageAll(ctx context.Context, options reader.FontUsageOptions) (reader.FontUsageReport, error) + func (s *Session) Info() (reader.DocumentInfo, []reader.DocumentPermissions, error) + func (s *Session) Layers(ctx context.Context, index int) ([]reader.LayerInfo, error) + func (s *Session) Media(ctx context.Context) ([]reader.MediaInfo, error) + func (s *Session) MediaExportData(ctx context.Context, scope int, id uint64) ([]byte, error) + func (s *Session) MediaImagePreview(ctx context.Context, scope int, id uint64) (preview.Image, error) + func (s *Session) MediaThumbnail(ctx context.Context, scope int, id uint64) (preview.Thumbnail, error) + func (s *Session) Outline() (reader.OutlineTree, error) + func (s *Session) Page(index int) (reader.PageInfo, error) + func (s *Session) PageLinksForPage(ctx context.Context, index int) ([]reader.PageLink, error) + func (s *Session) Pages() ([]reader.PageInfo, error) + func (s *Session) Permissions() ([]reader.DocumentPermissions, error) + func (s *Session) Preferences() (reader.ViewPreferences, error) + func (s *Session) RenderPDF(ctx context.Context, output io.Writer, indices []int, ...) error + func (s *Session) RenderPage(ctx context.Context, output io.Writer, index int, options reader.RenderOptions) error + func (s *Session) Search(ctx context.Context, query string, options reader.SearchOptions) (reader.SearchReport, error) + func (s *Session) SetHiddenLayers(index int, ids []string) error + func (s *Session) SignatureCertificate(ctx context.Context, scope int, id, slot string) ([]byte, error) + func (s *Session) SignatureDetails(ctx context.Context) ([]reader.SignatureInfo, error) + func (s *Session) SignatureSealPreview(ctx context.Context, scope int, id string, stampIndex int) (preview.Image, error) + func (s *Session) SignatureSealThumbnail(ctx context.Context, scope int, id string, index int) (preview.Thumbnail, error) + func (s *Session) SignatureSummaries(ctx context.Context) ([]SignatureSummary, error) + func (s *Session) SignatureValue(ctx context.Context, scope int, id string) ([]byte, error) + func (s *Session) Stats() (reader.DocumentStats, error) + func (s *Session) Text(index int) ([]reader.TextRun, error) + func (s *Session) Versions(ctx context.Context) ([]reader.VersionInfo, error) + type SignatureStampSummary struct + Boundary *reader.AnnotationBoundary + ID string + Page int + VisibleBoundary *reader.AnnotationBoundary + type SignatureSummary struct + Company string + Date string + ID string + Method string + Provider string + Scope int + Stamps []SignatureStampSummary + Version string