parser

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2026 License: Unlicense Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Common

type Common struct {
	BaseLoc   models.StLoc
	FileCache *core.Package
}

func (*Common) Init

func (p *Common) Init(fileCache *core.Package, dir models.StLoc)

type Document

type Document struct {
	Common
	models.Document
	Pages          []*Page
	Templates      map[models.StID]*models.PageContent
	DrawParams     map[models.StID]*models.DrawParam
	Res            map[models.StID]*models.MultiMedia
	FontRes        map[models.StID]*models.Font
	CompositeUnits map[models.StID]*models.CompositeGraphicUnit
	PublicRes      []*models.Res
	DocumentRes    []*models.Res
	Signs          map[models.StID]*models.Signature
	Seals          map[models.StID][]*SealInfo
	Annotations    map[models.StID]*models.PageAnnot
}

func (*Document) GetDrawParam

func (p *Document) GetDrawParam(id models.StID) *models.DrawParam

func (*Document) ParseSigns

func (p *Document) ParseSigns(file *models.StLoc) error

type OFD

type OFD struct {
	models.OFD

	Documents []*Document
	// contains filtered or unexported fields
}

OFD 表示一个OFD文档解析器

func NewOFD

func NewOFD(input any) (*OFD, error)

func (*OFD) Close

func (p *OFD) Close() error

Close 关闭OFD解析器并释放资源

func (*OFD) Open

func (p *OFD) Open(input any) error

Open 打开OFD文件,支持文件路径、字节数据或通用 io.Reader。 对于 io.Reader,Open 会读取全部内容,但不会关闭传入的 reader。

type Page

type Page struct {
	models.PageContent
	ID models.StID
}

type SealData

type SealData struct {
	FileType string // 文件类型: png, ofd, jpg, jpeg
	Data     []byte // 提取的字节数据
}

SealData 存储提取的签章数据。

func ExtractSealData

func ExtractSealData(source interface{}) (*SealData, error)

ExtractSealData 从签章数据中提取文件类型与内容,支持文件路径(string)、字节数据([]byte) 或 io.Reader 输入。

type SealInfo

type SealInfo struct {
	StampAnnot *models.StampAnnot
	SealData   *SealData
}

type Signature

type Signature struct {
	ID      models.StID  `xml:"ID,attr"`
	BaseLoc models.StLoc `xml:"BaseLoc,attr"`
}

type Signatures

type Signatures struct {
	XMLName    xml.Name    `xml:"Signatures"`
	Xmlns      string      `xml:"xmlns,attr"`
	MaxSignID  *string     `xml:"MaxSignId,omitempty"`
	Signatures []Signature `xml:"Signature,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL