models

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 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

Overview

Package models 提供复用pkg/spec标准声明的内部包装及快速解析入口。 标准声明与标准库 XML 解码复用pkg/spec;别名和少量内部包装衔接现有消费者。 快速解析、页面尺寸兜底及文字位置兼容策略仍留在内部。

Index

Constants

View Source
const (
	AnnotTypeLink       AnnotType     = spec.AnnotTypeLink
	AnnotTypePath       AnnotType     = spec.AnnotTypePath
	AnnotTypeHighlight  AnnotType     = spec.AnnotTypeHighlight
	AnnotTypeStamp      AnnotType     = spec.AnnotTypeStamp
	AnnotTypeWatermark  AnnotType     = spec.AnnotTypeWatermark
	PageItemText                      = spec.PageItemText
	PageItemPath                      = spec.PageItemPath
	PageItemImage                     = spec.PageItemImage
	PageItemComposite                 = spec.PageItemComposite
	PageItemBlock                     = spec.PageItemBlock
	Start                             = spec.Start
	MoveTo                            = spec.MoveTo
	LineTo                            = spec.LineTo
	CubicBezier                       = spec.CubicBezier
	QuadTo                            = spec.QuadTo
	ArcTo                             = spec.ArcTo
	Close                             = spec.Close
	DestTypeXYZ         DestType      = spec.DestTypeXYZ
	DestTypeFit         DestType      = spec.DestTypeFit
	DestTypeFitH        DestType      = spec.DestTypeFitH
	DestTypeFitV        DestType      = spec.DestTypeFitV
	DestTypeFitR        DestType      = spec.DestTypeFitR
	ActionEventDO       ActionEvent   = spec.ActionEventDO
	ActionEventPO       ActionEvent   = spec.ActionEventPO
	ActionEventClick    ActionEvent   = spec.ActionEventClick
	MovieOperatorPlay   MovieOperator = spec.MovieOperatorPlay
	MovieOperatorStop   MovieOperator = spec.MovieOperatorStop
	MovieOperatorPause  MovieOperator = spec.MovieOperatorPause
	MovieOperatorResume MovieOperator = spec.MovieOperatorResume
)

Variables

View Source
var IdentityMatrix = CTM{1, 0, 0, 1, 0, 0}

IdentityMatrix 供尚未迁移的内部消费者使用;公开调用方应使用 spec.IdentityCTM。

Functions

func EnsurePhysicalBox added in v0.1.9

func EnsurePhysicalBox(p *CtPageArea)

EnsurePhysicalBox 保留页面物理区域的兼容兜底,无效尺寸使用 A4。 这是读取/显示策略,不属于 pkg/spec 的标准声明解码。

Types

type ActionEvent

type ActionEvent = spec.ActionEvent

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type ActionGoto

type ActionGoto = spec.ActionGoto

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type ActionGotoA

type ActionGotoA = spec.ActionGotoA

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type ActionList

type ActionList = spec.ActionList

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type ActionMovie

type ActionMovie = spec.ActionMovie

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type ActionSound

type ActionSound = spec.ActionSound

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type ActionURI

type ActionURI = spec.ActionURI

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Actions

type Actions = spec.Actions

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Annot

type Annot = spec.Annot

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type AnnotPage

type AnnotPage = spec.AnnotPage

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type AnnotType

type AnnotType = spec.AnnotType

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Annotations

type Annotations = spec.Annotations

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Appearance

type Appearance = spec.Appearance

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type ArcData

type ArcData = spec.ArcData

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Area

type Area = spec.RegionArea

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Attachment

type Attachment = spec.Attachment

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Attachments

type Attachments = spec.Attachments

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type BookmarkList

type BookmarkList = spec.BookmarkList

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type BookmarkRef added in v0.1.9

type BookmarkRef = spec.BookmarkRef

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Border

type Border = spec.Border

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CTAxialShd

type CTAxialShd = spec.CTAxialShd

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CTBookmark

type CTBookmark = spec.Bookmark

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CTCGTransform

type CTCGTransform = spec.CTCGTransform

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

func ExpandCGTransformPositions added in v0.1.5

func ExpandCGTransformPositions(codes []TextCode, transforms []CTCGTransform) []CTCGTransform

ExpandCGTransformPositions 将按 TextCode 局部计数的 CGTransform.CodePosition 展开为整个文字对象内的字符位置。规范形式的全局递增位置保持原样;遇到位置重置 时,将后续位置解释为下一段 TextCode 内的偏移,兼容常见的逐字 TextCode 文档。

type CTColor

type CTColor = spec.CTColor

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CTGouraudShd

type CTGouraudShd = spec.CTGouraudShd

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CTGraphicUnit

type CTGraphicUnit = spec.CTGraphicUnit

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CTLaGouraudShd

type CTLaGouraudShd = spec.CTLaGouraudShd

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CTM

type CTM = spec.CTM

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CTOutlineElem

type CTOutlineElem = spec.OutlineElem

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CTPageBlock

type CTPageBlock = spec.CTPageBlock

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CTRadialShd

type CTRadialShd = spec.CTRadialShd

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CT_VPreferences

type CT_VPreferences = spec.VPreferences //nolint:revive // 分批迁移期间保留内部名称,公开类型不使用下划线。

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CellContent

type CellContent = spec.CellContent

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type ClipArea

type ClipArea = spec.ClipArea

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Clips

type Clips = spec.Clips

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Color

type Color = spec.ColorValue

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type ColorSpace

type ColorSpace = spec.ColorSpace

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type ColorSpaces

type ColorSpaces = spec.ColorSpaces

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CommandType

type CommandType = spec.CommandType

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CommonData

type CommonData = spec.CommonData

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CompositeGraphicUnit

type CompositeGraphicUnit = spec.CompositeGraphicUnit

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CompositeGraphicUnits

type CompositeGraphicUnits = spec.CompositeGraphicUnits

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CompositeObject

type CompositeObject = spec.CompositeObject

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Content

type Content = spec.Content

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CtAction

type CtAction = spec.Action

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CtClip

type CtClip = spec.CtClip

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CtComposite

type CtComposite = spec.CtComposite

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CtDest

type CtDest = spec.Dest

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CtImage

type CtImage = spec.CtImage

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CtLayer

type CtLayer = spec.CtLayer

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CtPageArea

type CtPageArea = spec.PageArea

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CtPath

type CtPath = spec.CtPath

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CtPattern

type CtPattern = spec.CtPattern

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CtRegion

type CtRegion = spec.Region

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CtText

type CtText = spec.CtText

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CustomTag

type CustomTag = spec.CustomTag

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type CustomTags

type CustomTags = spec.CustomTags

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type DestType

type DestType = spec.DestType

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Document

type Document = spec.Document

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

func ParseDocumentXML added in v0.1.4

func ParseDocumentXML(data []byte) (*Document, error)

ParseDocumentXML 解析 OFD 文档主体 XML。页面列表(Pages/Page)是打开文档时 解析量最大的部分——大文档动辄上千个仅含 ID/BaseLoc 的 Page 元素,用 encoding/xml 反射逐元素 unmarshal 会产生大量分配;这里直接用 tdewolff 的 零分配 XML lexer 重建。其余低频且复杂的子树(CommonData、Outlines、颜色、 权限等)用 fastxml.SpanElement 捕获字节区间后回退 encoding/xml,语义与 xml.Unmarshal 一致。

type DrawParam

type DrawParam = spec.DrawParam

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type DrawParams

type DrawParams = spec.DrawParams

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Extension

type Extension = spec.Extension

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type ExtensionProp

type ExtensionProp = spec.ExtensionProperty

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Extensions

type Extensions = spec.Extensions

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Font

type Font = spec.Font

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Fonts

type Fonts = spec.Fonts

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type GouraudPoint

type GouraudPoint = spec.GouraudPoint

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type ImageObject

type ImageObject = spec.ImageObject

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type LaGouraudPoint

type LaGouraudPoint = spec.LaGouraudPoint

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Layer

type Layer = spec.Layer

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type MovieOperator

type MovieOperator = spec.MovieOperator

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type MultiMedia

type MultiMedia = spec.MultiMedia

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type MultiMedias

type MultiMedias = spec.MultiMedias

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type OptionalBool added in v0.0.5

type OptionalBool = spec.OptionalBool

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

func NewOptionalBool added in v0.0.5

func NewOptionalBool(value bool) OptionalBool

NewOptionalBool 为尚未迁移的内部图元构造可选布尔属性。

type OutlineList

type OutlineList = spec.OutlineList

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Page

type Page = spec.PageRef

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type PageAnnot

type PageAnnot = spec.PageAnnot

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type PageBlock

type PageBlock = spec.PageBlock

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type PageContent

type PageContent spec.PageContent

PageContent 复用标准声明,并保留内部页面尺寸兼容策略。

func ParsePageContentXML added in v0.1.3

func ParsePageContentXML(data []byte) (*PageContent, error)

ParsePageContentXML 解析 OFD 页面内容 XML,入口语义与 xml.Unmarshal 一致: 第一个元素作为根元素跳过,子元素按名称匹配。

func (*PageContent) EnsurePhysicalBox added in v0.0.6

func (p *PageContent) EnsurePhysicalBox()

EnsurePhysicalBox 确保页面区域存在且物理区域有效;这不是标准声明解码行为。

type PageItem added in v0.0.5

type PageItem = spec.PageItem

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type PageItemKind added in v0.0.5

type PageItemKind = spec.PageItemKind

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type PageLayout

type PageLayout = spec.PageLayout

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type PageList

type PageList = spec.PageList

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type PageMode

type PageMode = spec.PageMode

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Palette

type Palette = spec.Palette

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Parameter

type Parameter = spec.Parameter

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Params

type Params = spec.Params

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Path

type Path = spec.RegionPath

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type PathCommand

type PathCommand = spec.PathCommand

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type PathObject

type PathObject = spec.PathObject

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Provider

type Provider = spec.Provider

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Reference

type Reference = spec.Reference

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type References

type References = spec.References

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Res

type Res = spec.Res

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

func ParseResXML added in v0.1.9

func ParseResXML(data []byte) (*Res, error)

ParseResXML 使用 fastxml.Lexer 解析资源文件。低频且结构复杂的资源子树仍由 fastxml.DecodeSpan 按模型解码,颜色空间和调色板则直接从词法 token 重建。

type SVGPath

type SVGPath = spec.PathData

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

func ParsePathData

func ParsePathData(data string) (SVGPath, error)

ParsePathData 在分批迁移期间复用公开模型的 OFD 紧缩路径解码。

type Seal

type Seal = spec.Seal

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Segment

type Segment = spec.Segment

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Signature

type Signature struct {
	spec.Signature

	Type     string `xml:"-"`
	Relative string `xml:"-"`
	FilePath string `xml:"-"`
}

Signature 将标准签名描述与内部加载上下文分开;上下文不参与 XML 解码。

type SignatureParameter added in v0.1.6

type SignatureParameter = spec.SignatureParameter

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type SignatureParameters added in v0.1.6

type SignatureParameters = spec.SignatureParameters

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Signatures

type Signatures = spec.Signatures

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type SignedInfo

type SignedInfo = spec.SignedInfo

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type StArray

type StArray[T float64 | int] = spec.StArray[T]

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type StBox

type StBox = spec.StBox

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type StID

type StID = spec.StID

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type StPos

type StPos = spec.StPos

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type StRefID

type StRefID = spec.StRefID

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type StampAnnot

type StampAnnot = spec.StampAnnot

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type TabDisplay

type TabDisplay = spec.TabDisplay

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type Template

type Template = spec.Template

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type TemplatePage

type TemplatePage = spec.TemplatePage

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type TextCode

type TextCode = spec.TextCode

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type TextObject

type TextObject = spec.TextObject

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type ZOrder added in v0.1.3

type ZOrder = spec.ZOrder

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

type ZoomSetting

type ZoomSetting = spec.ZoomSetting

内部模型在分批迁移期间复用公开类型,避免维护两份声明和编解码行为。

Jump to

Keyboard shortcuts

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