Versions in this module Expand all Collapse all v0 v0.1.8 Oct 31, 2026 Changes in this version + var ErrPermissionDenied = errors.New("文档权限不允许此操作") + func FallbackFontData(family string) ([]byte, bool) + func RegisterFallbackFont(source FontSource) error + func UnregisterFallbackFont(family string) error + type AnnotationBoundary struct + Height float64 + Width float64 + X float64 + Y float64 + type AnnotationInfo struct + Boundary *AnnotationBoundary + Creator string + Dest *OutlineDest + ID string + LastModDate string + Page int + Remark string + Scope int + Subtype string + TargetPage int + Type string + URI string + Visible bool + type AttachmentInfo struct + ActualSize int64 + Exists bool + Format string + HasSize bool + ID string + Name string + Scope int + Size int64 + Usage string + Visible bool + type Bookmark struct + Dest *OutlineDest + Name string + Page int + type CertificateDetail struct + Algorithm string + CertificateValid bool + CommonName string + Country string + Error string + Issuer string + Locality string + NotAfter string + NotBefore string + Organization string + OrganizationalUnit string + Province string + PublicKey string + RevocationChecked bool + RevocationError string + RevocationStatus string + SerialNumber string + SignatureFormat string + SignatureValid bool + Slot string + SlotKey string + Subject string + TrustChecked bool + TrustError string + Trusted bool + type CustomTagNode struct + Attributes map[string]string + Children []*CustomTagNode + Name string + Namespace string + Target *CustomTagTarget + Text string + type CustomTagTarget struct + Height float64 + ObjectID uint64 + ObjectText string + Page int + PageID uint64 + Width float64 + X float64 + Y float64 + type CustomTagTree struct + Namespace string + Path string + Root *CustomTagNode + type DocumentInfo struct + Abstract string + Author string + CreationDate string + Creator string + DocID string + ModDate string + Subject string + Title string + Version string + type DocumentPermissions struct + Annot bool + Declared bool + Edit bool + EndDate string + Export bool + Pages []int + PrintCopies int + PrintScreen bool + Printable bool + Scope int + Signature bool + StartDate string + Watermark bool + type DocumentStats struct + AnnotationPages int + Attachments int + Fonts int + Media int + Signatures int + type FontInfo struct + Bold bool + Embedded bool + Family string + FixedWidth bool + Format string + ID uint64 + Italic bool + Name string + Scope int + Serif bool + type FontRef struct + ID uint64 + Scope int + type FontResource struct + Bold bool + Data []byte + Family string + Format string + ID uint64 + Italic bool + Name string + type FontSource struct + Data []byte + Family string + Italic bool + Name string + Weight int + type FontUsage struct + Pages []int + Scanned int + Truncated bool + type FontUsageOptions struct + MaxPages int + MaxScan int + type FontUsageReport struct + Fonts []FontUsageSummary + Scanned int + Truncated bool + type FontUsageSummary struct + ID uint64 + Pages []int + Scope int + type Glyph struct + Angle float64 + Height float64 + Text string + Width float64 + X float64 + Y float64 + type LayerInfo struct + ID string + Key string + Kind string + Name string + Objects int + Type string + Visible bool + type MediaInfo struct + Exists bool + Format string + ID uint64 + Name string + Scope int + Size int64 + Type string + type OpenOptions struct + PageCacheBytes int64 + PageCacheCapacity int + type OutlineDest struct + Bottom *float64 + Left *float64 + Right *float64 + Top *float64 + Type string + Zoom *float64 + type OutlineNode struct + Children []OutlineNode + Dest *OutlineDest + Expanded *bool + Page int + Title string + URI string + type OutlineTree struct + Bookmarks []Bookmark + Nodes []OutlineNode + PageMode string + type PageInfo struct + Height float64 + Index int + Width float64 + type PageLink struct + AttachmentID string + AttachmentName string + Boundary AnnotationBoundary + Dest *OutlineDest + Event string + ID string + MediaID uint64 + MediaKind string + Operator string + Page int + Repeat bool + Scope int + TargetPage int + URI string + Volume *int + type PermissionAction string + const PermissionCopy + const PermissionExport + const PermissionPrint + type Reader struct + func Open(input any, options ...OpenOptions) (*Reader, error) + func (r *Reader) Annotations() ([]AnnotationInfo, error) + func (r *Reader) AttachmentData(scope int, id string, maxBytes int64) ([]byte, error) + func (r *Reader) Attachments() ([]AttachmentInfo, error) + func (r *Reader) CheckDocumentPermission(action PermissionAction, scope int) error + func (r *Reader) CheckPermission(action PermissionAction, indices []int) error + func (r *Reader) Close() error + func (r *Reader) CustomTags() ([]CustomTagTree, error) + func (r *Reader) FontList() ([]FontInfo, error) + func (r *Reader) FontUsage(ref FontRef, options FontUsageOptions) (FontUsage, error) + func (r *Reader) FontUsageAll(options FontUsageOptions) (FontUsageReport, error) + func (r *Reader) Fonts() ([]FontResource, error) + func (r *Reader) Info() (DocumentInfo, error) + func (r *Reader) Layers(index int) ([]LayerInfo, error) + func (r *Reader) Media() ([]MediaInfo, error) + func (r *Reader) MediaData(scope int, mediaID uint64, maxBytes int64) ([]byte, error) + func (r *Reader) Outline() (OutlineTree, error) + func (r *Reader) Page(index int) (PageInfo, error) + func (r *Reader) PageCount() int + func (r *Reader) PageEntryActionsForPage(index int) ([]PageLink, error) + func (r *Reader) PageLinks() ([]PageLink, error) + func (r *Reader) PageLinksForPage(index int) ([]PageLink, error) + func (r *Reader) PageMediaActions() ([]PageLink, error) + func (r *Reader) PageMediaActionsForPage(index int) ([]PageLink, error) + func (r *Reader) Pages() ([]PageInfo, error) + func (r *Reader) Permissions() ([]DocumentPermissions, error) + func (r *Reader) Preferences() (ViewPreferences, error) + func (r *Reader) RemoveFallbackFont(family string) error + func (r *Reader) RenderPDF(ctx context.Context, output io.Writer, indices []int, options RenderOptions) (err error) + func (r *Reader) RenderPage(ctx context.Context, output io.Writer, index int, options RenderOptions) error + func (r *Reader) RenderPageWithReport(ctx context.Context, output io.Writer, index int, options RenderOptions) (RenderReport, error) + func (r *Reader) RenderPages(ctx context.Context, indices []int, options RenderOptions, ...) error + func (r *Reader) Search(ctx context.Context, query string, options SearchOptions) (SearchReport, error) + func (r *Reader) SelectVersion(scope int, id string) error + func (r *Reader) SetHiddenLayers(index int, ids []string) error + func (r *Reader) SetTextOptions(options TextOptions) error + func (r *Reader) SignatureCertificate(scope int, signatureID string, slot string) ([]byte, error) + func (r *Reader) SignatureSeal(scope int, signatureID string, stampIndex int) ([]byte, string, error) + func (r *Reader) SignatureValue(scope int, signatureID string) ([]byte, error) + func (r *Reader) Signatures() ([]SignatureInfo, error) + func (r *Reader) Stats() (DocumentStats, error) + func (r *Reader) Text(index int) ([]TextRun, error) + func (r *Reader) UseFallbackFont(family string) error + func (r *Reader) Versions() ([]VersionInfo, error) + type Rect struct + Angle float64 + Height float64 + Width float64 + X float64 + Y float64 + type RenderFormat string + const RenderJPG + const RenderPNG + const RenderSVG + type RenderOptions struct + Background color.Color + DPI float64 + Format RenderFormat + PNGCompressionLevel int + Purpose PermissionAction + type RenderPageConsumer func(ctx context.Context, position, pageIndex int, data []byte) error + type RenderReport = render.Report + type SearchOptions struct + MaxPages int + MaxResults int + type SearchReport struct + Results []SearchResult + Scanned int + Truncated bool + type SearchResult struct + End int + Page int + Rects []Rect + Run int + Start int + Text string + type SignatureInfo struct + Certificates []CertificateDetail + Company string + DataHashMatch bool + Date string + DigestMethod string + DigestValid bool + HasDataHash bool + HasDigest bool + HasVerification bool + ID string + Method string + Provider string + References []SignatureReference + Scope int + Stamps []SignatureStamp + TrustChecked bool + Trusted bool + Validation *parser.SignatureValidation + VerificationError string + Verified bool + Version string + type SignatureReference struct + Error string + Exists bool + FileRef string + Match bool + type SignatureStamp struct + Boundary *AnnotationBoundary + HasSeal bool + ID string + Page int + SealType string + VisibleBoundary *AnnotationBoundary + type TextOptions = render.TextOptions + type TextRun struct + Bold bool + CharDirection int + Font uint64 + FontFamily string + Glyphs []Glyph + Height float64 + Italic bool + ReadDirection int + Scope int + Size float64 + Source string + Text string + Weight int + Width float64 + X float64 + Y float64 + type VersionInfo struct + CreationDate string + Current bool + DocRoot string + ID string + Index int + Name string + Pages []int + Scope int + Version string + type ViewPreferences struct + PageLayout string + Zoom *float64 + ZoomMode string