Documentation
¶
Index ¶
- Variables
- type ActionEvent
- type ActionGoto
- type ActionGotoA
- type ActionList
- type ActionMovie
- type ActionSound
- type ActionURI
- type Actions
- type Annot
- type AnnotPage
- type AnnotType
- type Annotations
- type Appearance
- type ArcData
- type Area
- type Attachment
- type Attachments
- type BookmarkList
- type Border
- type CTAxialShd
- type CTBookmark
- type CTCGTransform
- type CTColor
- type CTGouraudShd
- type CTGraphicUnit
- type CTLaGouraudShd
- type CTM
- func (c *CTM) Multiply(other *CTM) *CTM
- func (c *CTM) RotationAngle() float64
- func (c *CTM) RotationAngleDegrees() float64
- func (c *CTM) String() string
- func (c *CTM) Transform(x, y float64) (float64, float64)
- func (c *CTM) TransformPoint(p StPos) (float64, float64)
- func (c *CTM) UnmarshalXMLAttr(attr xml.Attr) error
- func (c *CTM) YScale() float64
- type CTOutlineElem
- type CTPageBlock
- type CTRadialShd
- type CT_Permission
- type CT_VPreferences
- type CellContent
- type ClipArea
- type Clips
- type Color
- type ColorSpace
- type ColorSpaces
- type CommandType
- type CommonData
- type CompositeGraphicUnit
- type CompositeGraphicUnits
- type CompositeObject
- type Content
- type CtAction
- type CtClip
- type CtComposite
- type CtDest
- type CtImage
- type CtLayer
- type CtPageArea
- type CtPath
- type CtPattern
- type CtRegion
- type CtText
- type CustomData
- type CustomDatas
- type CustomTag
- type CustomTags
- type DateTime
- type DestType
- type DocBody
- type DocInfo
- type DocVersion
- type Document
- type DrawParam
- type DrawParams
- type Extension
- type ExtensionProp
- type Extensions
- type FileList
- type Font
- type Fonts
- type GouraudPoint
- type ImageObject
- type Keywords
- type LaGouraudPoint
- type Layer
- type MovieOperator
- type MultiMedia
- type MultiMedias
- type OFD
- type OutlineList
- type Page
- type PageAnnot
- type PageBlock
- type PageContent
- type PageLayout
- type PageList
- type PageMode
- type Palette
- type Parameter
- type Params
- type Path
- type PathCommand
- type PathObject
- type PrintSettings
- type Provider
- type Reference
- type References
- type Res
- type SVGPath
- func (p *SVGPath) AddCommand(cmd PathCommand)
- func (p SVGPath) CalculateBoundingBox() (minX, minY, maxX, maxY float64)
- func (p *SVGPath) Clear()
- func (p SVGPath) CountCommands() map[CommandType]int
- func (p SVGPath) Format() string
- func (p SVGPath) GetCommand(index int) (PathCommand, error)
- func (p SVGPath) GetStartPoint(cmdIndex int) (StPos, error)
- func (p SVGPath) Length() int
- func (p SVGPath) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (p SVGPath) String() string
- func (p *SVGPath) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- type Seal
- type Segment
- type SigType
- type Signature
- type Signatures
- type SignedInfo
- type StArray
- type StArrayF
- func (s StArrayF) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (s StArrayF) MarshalXMLAttr(name xml.Name) (xml.Attr, error)
- func (s StArrayF) String() string
- func (s *StArrayF) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- func (s *StArrayF) UnmarshalXMLAttr(attr xml.Attr) error
- type StArrayI
- func (s StArrayI) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (s StArrayI) MarshalXMLAttr(name xml.Name) (xml.Attr, error)
- func (s StArrayI) String() string
- func (s *StArrayI) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- func (s *StArrayI) UnmarshalXMLAttr(attr xml.Attr) error
- type StBox
- func (p *StBox) Area() float64
- func (p *StBox) CopyAndShift(box *StBox) StBox
- func (p *StBox) IsPortrait() bool
- func (p *StBox) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (p *StBox) String() string
- func (b *StBox) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- func (b *StBox) UnmarshalXMLAttr(attr xml.Attr) error
- type StID
- type StLoc
- func (p StLoc) Base() string
- func (p StLoc) Clean() StLoc
- func (p StLoc) Dir() StLoc
- func (p StLoc) Ext() string
- func (p StLoc) HasPrefix(prefix StLoc) bool
- func (p StLoc) In(dir StLoc) bool
- func (p StLoc) IsAbsolute() bool
- func (p StLoc) IsEmpty() bool
- func (p StLoc) Join(elem ...string) StLoc
- func (p StLoc) Resolve(base StLoc) StLoc
- func (p StLoc) String() string
- func (p StLoc) TrimPrefix(prefix StLoc) StLoc
- type StPos
- type StRefID
- type StampAnnot
- type TabDisplay
- type Template
- type TemplatePage
- type TextCode
- type TextObject
- type ValidPeriod
- type Version
- type VersionFile
- type Versions
- type ZoomSetting
Constants ¶
This section is empty.
Variables ¶
var IdentityMatrix = CTM{1, 0, 0, 1, 0, 0}
Functions ¶
This section is empty.
Types ¶
type ActionEvent ¶
type ActionEvent string
ActionEvent 动作事件类型
const ( ActionEventDO ActionEvent = "DO" ActionEventPO ActionEvent = "PO" ActionEventClick ActionEvent = "CLICK" )
type ActionGoto ¶
type ActionGoto struct {
Dest *CtDest `xml:"Dest,omitempty"`
Bookmark *struct {
Name string `xml:"Name,attr"`
} `xml:"Bookmark,omitempty"`
}
ActionGoto 跳转动作
type ActionGotoA ¶
type ActionGotoA struct {
AttachID string `xml:"AttachID,attr"`
NewWindow bool `xml:"NewWindow,attr,omitempty"`
}
ActionGotoA 附件跳转动作
type ActionList ¶
type ActionList struct {
Actions []CtAction `xml:"Action"`
}
type ActionMovie ¶
type ActionMovie struct {
ResourceID StRefID `xml:"ResourceID,attr"`
Operator MovieOperator `xml:"Operator,attr,omitempty"`
}
ActionMovie 影片动作
type ActionSound ¶
type ActionSound struct {
ResourceID StRefID `xml:"ResourceID,attr"`
Volume *int `xml:"Volume,attr,omitempty"`
Repeat *bool `xml:"Repeat,attr,omitempty"`
Synchronous *bool `xml:"Synchronous,attr,omitempty"`
}
ActionSound 声音动作
type ActionURI ¶
type ActionURI struct {
URI string `xml:"URI,attr"`
Base *string `xml:"Base,attr,omitempty"`
Target *string `xml:"Target,attr,omitempty"`
}
ActionURI URI动作
type Annot ¶
type Annot struct {
ID string `xml:"ID,attr"`
Type AnnotType `xml:"Type,attr"`
Creator string `xml:"Creator,attr"`
LastModDate DateTime `xml:"LastModDate,attr"`
Visible bool `xml:"Visible,attr,omitempty"`
Subtype string `xml:"Subtype,attr,omitempty"`
Print bool `xml:"Print,attr,omitempty"`
NoZoom bool `xml:"NoZoom,attr,omitempty"`
NoRotate bool `xml:"NoRotate,attr,omitempty"`
ReadOnly bool `xml:"ReadOnly,attr,omitempty"`
Remark *string `xml:"Remark,omitempty"`
Parameters *Params `xml:"Parameters,omitempty"`
Appearance *Appearance `xml:"Appearance"`
}
Annot 单个注解定义
type Annotations ¶
type Annotations struct {
XMLName xml.Name `xml:"Annotations"`
Xmlns string `xml:"xmlns,attr"`
Pages []AnnotPage `xml:"Page,omitempty"`
}
Annotations 注解列表容器
type Appearance ¶
type Appearance struct {
Boundary *StBox `xml:"Boundary,attr,omitempty"`
CTPageBlock
}
Appearance 注解外观
type ArcData ¶
type ArcData struct {
RX, RY float64 // 椭圆半径
XAxisRotation float64 // x轴旋转角度(度)
LargeArcFlag bool // 大弧标志
SweepFlag bool // 扫过标志
EndPoint StPos // 终点坐标
}
ArcData 定义椭圆弧参数
type Attachment ¶
type Attachment struct {
ID string `xml:"ID,attr"`
Name string `xml:"Name,attr"`
Format *string `xml:"Format,attr,omitempty"`
CreationDate *time.Time `xml:"CreationDate,attr,omitempty"`
ModDate *time.Time `xml:"ModDate,attr,omitempty"`
Size *float64 `xml:"Size,attr,omitempty"`
Visible bool `xml:"Visible,attr,omitempty"`
Usage string `xml:"Usage,attr,omitempty"`
FileLoc StLoc `xml:"FileLoc"`
}
Attachment 单个附件定义
type Attachments ¶
type Attachments struct {
XMLName xml.Name `xml:"Attachments"`
Xmlns string `xml:"xmlns,attr"`
Attachments []Attachment `xml:"Attachment,omitempty"`
}
Attachments 附件列表容器
type BookmarkList ¶
type BookmarkList struct {
Bookmarks []CTBookmark `xml:"Bookmark"`
}
type Border ¶
type Border struct {
BorderColor *CTColor `xml:"BorderColor"`
LineWidth float64 `xml:"LineWidth,attr,omitempty"`
HorizonalCornerRadius float64 `xml:"HorizonalCornerRadius,attr,omitempty"`
VerticalCornerRadius float64 `xml:"VerticalCornerRadius,attr,omitempty"`
DashOffset float64 `xml:"DashOffset,attr,omitempty"`
DashPattern StArray `xml:"DashPattern,attr,omitempty"`
}
type CTAxialShd ¶
type CTAxialShd struct {
Segment []Segment `xml:"Segment"`
MapType string `xml:"MapType,attr,omitempty"` // Direct, Repeat, Reflect
MapUnit float64 `xml:"MapUnit,attr,omitempty"`
Extend int `xml:"Extend,attr,omitempty"` // 0,1,2,3
StartPoint StPos `xml:"StartPoint,attr"`
EndPoint StPos `xml:"EndPoint,attr"`
}
type CTBookmark ¶
type CTCGTransform ¶
type CTColor ¶
type CTColor struct {
Pattern *CtPattern `xml:"Pattern"`
AxialShd *CTAxialShd `xml:"AxialShd"`
RadialShd *CTRadialShd `xml:"RadialShd"`
GouraudShd *CTGouraudShd `xml:"GouraudShd"`
LaGourandShd *CTLaGouraudShd `xml:"LaGourandShd"`
// Value 颜色值,指定了当前颜色空间下各通道的取值。
//Value的取值应符合"通道 1 通道 2 通道 3 …"格式。
//此属性不出现时,应参考 Index 属性从颜色空间的调色版中取值。当二者都不出现时,该颜色各通道的值全部为 0
//
//可选
Value *Color `xml:"Value,attr,omitempty"`
// Index 调色板中颜色的编号,非负整数,将从当前颜色空间的调色板中取出相应索引的预定义颜色用来绘制。
//索引从0开始 可选
Index int `xml:"Index,attr,omitempty"`
ColorSpace StRefID `xml:"ColorSpace,attr,omitempty"`
// Alpha 颜色透明度,在 0~255 之间取值。默认为 255,表示完全不透明
//
//可选
Alpha *uint8 `xml:"Alpha,attr,omitempty"`
}
type CTGouraudShd ¶
type CTGouraudShd struct {
Point []GouraudPoint `xml:"Point"`
BackColor *CTColor `xml:"BackColor,omitempty"`
Extend int `xml:"Extend,attr,omitempty"`
}
type CTGraphicUnit ¶
type CTGraphicUnit struct {
Actions *Actions `xml:"Actions"`
Clips *Clips `xml:"Clips"`
Boundary StBox `xml:"Boundary,attr"`
Name string `xml:"Name,attr,omitempty"`
Visible bool `xml:"Visible,attr,omitempty"`
CTM *CTM `xml:"CTM,attr,omitempty"`
DrawParam StRefID `xml:"DrawParam,attr,omitempty"`
LineWidth float64 `xml:"LineWidth,attr,omitempty"`
// 线端点样式,枚举值,指定了一条线的端点样式。默认值为 Butt
Cap string `xml:"Cap,attr,omitempty"` // Butt, Round, Square
Join string `xml:"Join,attr,omitempty"` // Miter, Round, Bevel
// Join 为 Miter 时小角度 JoinSize 的截断值,默认值为 3.528。当 Join 不等于 Miter 时该参数无效
MiterLimit float64 `xml:"MiterLimit,attr,omitempty"`
DashOffset float64 `xml:"DashOffset,attr,omitempty"`
DashPattern *StArrayF `xml:"DashPattern,attr,omitempty"`
Alpha *uint8 `xml:"Alpha,attr,omitempty"`
}
type CTLaGouraudShd ¶
type CTLaGouraudShd struct {
Point []LaGouraudPoint `xml:"Point"`
BackColor *CTColor `xml:"BackColor,omitempty"`
VerticesPerRow int `xml:"VerticesPerRow,attr"`
Extend int `xml:"Extend,attr,omitempty"`
}
type CTM ¶
type CTM [6]float64
CTM 表示OFD图元变换矩阵
func (*CTM) Multiply ¶
Multiply 矩阵乘法:计算 this × other CTM 是3x2矩阵,但实际上是3x3齐次坐标的2D仿射变换矩阵 矩阵形式: [ a c e ] [ b d f ] [ 0 0 1 ]
func (*CTM) RotationAngleDegrees ¶
RotationAngleDegrees 提取旋转角度(度)
func (*CTM) TransformPoint ¶
TransformPoint 变换点坐标
func (*CTM) UnmarshalXMLAttr ¶
UnmarshalXMLAttr 实现XML属性解析
type CTOutlineElem ¶
type CTOutlineElem struct {
Title string `xml:"Title,attr"`
Count *int `xml:"Count,attr,omitempty"`
Expanded *bool `xml:"Expanded,attr,omitempty"`
Actions *ActionList `xml:"Actions,omitempty"`
OutlineElem []CTOutlineElem `xml:"OutlineElem,omitempty"`
}
type CTPageBlock ¶
type CTPageBlock struct {
TextObject []TextObject `xml:"TextObject"`
PathObject []PathObject `xml:"PathObject"`
ImageObject []ImageObject `xml:"ImageObject"`
CompositeObject []CompositeObject `xml:"CompositeObject"`
PageBlock []PageBlock `xml:"PageBlock"`
}
type CTRadialShd ¶
type CTRadialShd struct {
Segment []Segment `xml:"Segment"`
MapType string `xml:"MapType,attr,omitempty"` // Direct, Repeat, Reflect
MapUnit float64 `xml:"MapUnit,attr,omitempty"`
Eccentricity float64 `xml:"Eccentricity,attr,omitempty"`
Angle float64 `xml:"Angle,attr,omitempty"`
StartPoint StPos `xml:"StartPoint,attr"`
StartRadius float64 `xml:"StartRadius,attr,omitempty"`
EndPoint StPos `xml:"EndPoint,attr"`
EndRadius float64 `xml:"EndRadius,attr"`
Extend int `xml:"Extend,attr,omitempty"`
}
type CT_Permission ¶
type CT_Permission struct {
Edit *bool `xml:"Edit,omitempty"`
Annot *bool `xml:"Annot,omitempty"`
Export *bool `xml:"Export,omitempty"`
Signature *bool `xml:"Signature,omitempty"`
Watermark *bool `xml:"Watermark,omitempty"`
PrintScreen *bool `xml:"PrintScreen,omitempty"`
Print *PrintSettings `xml:"Print,omitempty"`
ValidPeriod *ValidPeriod `xml:"ValidPeriod,omitempty"`
}
type CT_VPreferences ¶
type CT_VPreferences struct {
PageMode *PageMode `xml:"PageMode,omitempty"`
PageLayout *PageLayout `xml:"PageLayout,omitempty"`
TabDisplay *TabDisplay `xml:"TabDisplay,omitempty"`
HideToolbar *bool `xml:"HideToolbar,omitempty"`
HideMenubar *bool `xml:"HideMenubar,omitempty"`
HideWindowUI *bool `xml:"HideWindowUI,omitempty"`
Zoom *ZoomSetting `xml:",omitempty"`
}
type CellContent ¶
type CellContent struct {
Thumbnail StRefID `xml:"Thumbnail,attr,omitempty"`
CTPageBlock
}
type Color ¶
func (Color) MarshalXML ¶
MarshalXML 生成 XML
func (Color) MarshalXMLAttr ¶
MarshalXMLAttr 生成 XML 属性
func (*Color) UnmarshalXML ¶
UnmarshalXML 解析 XML 元素
type ColorSpace ¶
type ColorSpaces ¶
type ColorSpaces struct {
ColorSpace []ColorSpace `xml:"ColorSpace"`
}
type CommandType ¶
type CommandType string
CommandType 定义路径命令类型 M: 移动到 (Move to) L: 直线到 (Line to) B: 三次贝塞尔曲线 (Cubic Bezier curve) Q: 二次贝塞尔曲线 (Quadratic Bezier curve) A: 椭圆弧 (Elliptical arc) C: 闭合路径 (Close path)
const ( MoveTo CommandType = "M" // 移动到命令 LineTo CommandType = "L" // 直线命令 CubicBezier CommandType = "B" // 三次贝塞尔曲线命令 QuadTo CommandType = "Q" // 二次贝塞尔曲线命令 ArcTo CommandType = "A" // 椭圆弧命令 Close CommandType = "C" // 闭合路径命令 )
type CommonData ¶
type CommonData struct {
MaxUnitID StID `xml:"MaxUnitID"`
PageArea CtPageArea `xml:"PageArea"`
PublicRes []StLoc `xml:"PublicRes,omitempty"`
DocumentRes []StLoc `xml:"DocumentRes,omitempty"`
TemplatePages []TemplatePage `xml:"TemplatePage,omitempty"`
DefaultCS *StRefID `xml:"DefaultCS,omitempty"`
}
type CompositeGraphicUnit ¶
type CompositeGraphicUnits ¶
type CompositeGraphicUnits struct {
CompositeGraphicUnit []CompositeGraphicUnit `xml:"CompositeGraphicUnit"`
}
type CompositeObject ¶
type CompositeObject struct {
ID StID `xml:"ID,attr"`
CtComposite // 嵌入CT_Composite
}
type CtAction ¶
type CtAction struct {
Event ActionEvent `xml:"Event,attr"`
Region *CtRegion `xml:"Region,omitempty"`
// 动作选择项
Goto *ActionGoto `xml:"Goto,omitempty"`
URI *ActionURI `xml:"URI,omitempty"`
GotoA *ActionGotoA `xml:"GotoA,omitempty"`
Sound *ActionSound `xml:"Sound,omitempty"`
Movie *ActionMovie `xml:"Movie,omitempty"`
}
CtAction 动作定义
type CtComposite ¶
type CtComposite struct {
CTGraphicUnit
ResourceID StRefID `xml:"ResourceID,attr"`
}
type CtDest ¶
type CtDest struct {
Type DestType `xml:"Type,attr"`
PageID StRefID `xml:"PageID,attr"`
Left *float64 `xml:"Left,attr,omitempty"`
Top *float64 `xml:"Top,attr,omitempty"`
Right *float64 `xml:"Right,attr,omitempty"`
Bottom *float64 `xml:"Bottom,attr,omitempty"`
Zoom *float64 `xml:"Zoom,attr,omitempty"`
}
CtDest 目标定义
type CtImage ¶
type CtImage struct {
CTGraphicUnit
Border *Border `xml:"Border"`
ResourceID StRefID `xml:"ResourceID,attr"`
Substitution StRefID `xml:"Substitution,attr,omitempty"`
ImageMask StRefID `xml:"ImageMask,attr,omitempty"`
}
type CtLayer ¶
type CtLayer struct {
Type string `xml:"Type,attr,omitempty"`
DrawParam StRefID `xml:"DrawParam,attr,omitempty"`
CTPageBlock
}
type CtPageArea ¶
type CtPageArea struct {
PhysicalBox StBox `xml:"PhysicalBox"`
ApplicationBox *StBox `xml:"ApplicationBox,omitempty"`
ContentBox *StBox `xml:"ContentBox,omitempty"`
BleedBox *StBox `xml:"BleedBox,omitempty"`
}
CtPageArea 页面区域定义
type CtPath ¶
type CtPath struct {
CTGraphicUnit
StrokeColor *CTColor `xml:"StrokeColor"`
FillColor *CTColor `xml:"FillColor"`
AbbreviatedData SVGPath `xml:"AbbreviatedData"`
// Stroke 是否钩边 默认 true
Stroke string `xml:"Stroke,attr,omitempty"`
Fill bool `xml:"Fill,attr,omitempty"`
Rule string `xml:"Rule,attr,omitempty"` // NonZero, Even-Odd
}
type CtPattern ¶
type CtPattern struct {
CellContent CellContent `xml:"CellContent"`
Width float64 `xml:"Width,attr"`
Height float64 `xml:"Height,attr"`
XStep float64 `xml:"XStep,attr,omitempty"`
YStep float64 `xml:"YStep,attr,omitempty"`
ReflectMethod string `xml:"ReflectMethod,attr,omitempty"` // Normal, Row, Column, RowAndColumn
RelativeTo string `xml:"RelativeTo,attr,omitempty"` // Page, Object
CTM StArray `xml:"CTM,attr,omitempty"`
}
type CtText ¶
type CtText struct {
CTGraphicUnit
FillColor *CTColor `xml:"FillColor"`
StrokeColor *CTColor `xml:"StrokeColor"`
CGTransform []CTCGTransform `xml:"CGTransform"`
TextCode []TextCode `xml:"TextCode"`
Font StRefID `xml:"Font,attr"`
// Size 字号,单位为毫米
Size float64 `xml:"Size,attr"`
// Stroke 是否描边。默认值为 false 当文字对象被裁剪区引用时此属性被忽略
Stroke bool `xml:"Stroke,attr,omitempty"`
// Fill 是否填充 默认值 true 当文字对象被裁剪区引用时此属性被忽略
Fill string `xml:"Fill,attr,omitempty"`
// HScale 字型在水平方向的放缩比,取值为[0 1.0],默认值为 1.0
// 例如:当 HScale 值为 0.5 时表示实际显示的字宽为原来字宽的一半
HScale float64 `xml:"HScale,attr,omitempty"`
// ReadDirection 阅读方向,指定了文字排列的方向,默认值为 0
ReadDirection int `xml:"ReadDirection,attr,omitempty"`
// CharDirection 字符方向,指定了文字放置的方式,默认值为 0
CharDirection int `xml:"CharDirection,attr,omitempty"`
Weight int `xml:"Weight,attr,omitempty"` // 0,100,...,1000
// Italic 是否是斜体样式,默认值为 false
Italic bool `xml:"Italic,attr,omitempty"`
}
type CustomData ¶
CustomData 自定义数据
type CustomDatas ¶
type CustomDatas struct {
CustomData []CustomData `xml:"CustomData"`
}
CustomDatas 自定义数据集合
type CustomTag ¶
type CustomTag struct {
NameSpace string `xml:"NameSpace,attr"`
SchemaLoc *StLoc `xml:"SchemaLoc,omitempty"`
FileLoc StLoc `xml:"FileLoc"`
}
CustomTag 单个自定义标签定义
type CustomTags ¶
type CustomTags struct {
XMLName xml.Name `xml:"CustomTags"`
Xmlns string `xml:"xmlns,attr"`
CustomTags []CustomTag `xml:"CustomTag,omitempty"`
}
CustomTags 自定义标签容器
type DateTime ¶
DateTime 自定义时间类型,用于解析OFD中的时间格式
func (*DateTime) MarshalXML ¶
MarshalXML 自定义XML序列化方法
func (*DateTime) MarshalXMLAttr ¶
MarshalXMLAttr 自定义XML属性序列化方法
func (*DateTime) UnmarshalXML ¶
UnmarshalXML 自定义XML元素解析方法
type DocBody ¶
type DocBody struct {
DocInfo DocInfo `xml:"DocInfo"`
DocRoot StLoc `xml:"DocRoot"`
Versions *Versions `xml:"Versions,omitempty"`
Signatures *StLoc `xml:"Signatures,omitempty"`
}
DocBody 文档体
type DocInfo ¶
type DocInfo struct {
DocID string `xml:"DocID"`
Title *string `xml:"Title,omitempty"`
Author *string `xml:"Author,omitempty"`
Subject *string `xml:"Subject,omitempty"`
Abstract *string `xml:"Abstract,omitempty"`
CreationDate *DateTime `xml:"CreationDate,omitempty"`
ModDate *DateTime `xml:"ModDate,omitempty"`
DocUsage *string `xml:"DocUsage,omitempty"`
Cover *StLoc `xml:"Cover,omitempty"`
Keywords *Keywords `xml:"Keywords,omitempty"`
Creator *string `xml:"Creator,omitempty"`
CreatorVersion *string `xml:"CreatorVersion,omitempty"`
CustomDatas *CustomDatas `xml:"CustomDatas,omitempty"`
}
DocInfo 文档信息
type DocVersion ¶
type DocVersion struct {
XMLName xml.Name `xml:"DocVersion"`
Xmlns string `xml:"xmlns,attr"`
ID string `xml:"ID,attr"`
Version *string `xml:"Version,attr,omitempty"`
Name *string `xml:"Name,attr,omitempty"`
CreationDate *time.Time `xml:"CreationDate,attr,omitempty"`
FileList FileList `xml:"FileList"`
DocRoot StLoc `xml:"DocRoot"`
}
DocVersion 文档版本信息
type Document ¶
type Document struct {
XMLName xml.Name `xml:"Document"`
XMLNS string `xml:"xmlns:ofd,attr"`
CommonData CommonData `xml:"CommonData"`
Pages PageList `xml:"Pages"`
Outlines *OutlineList `xml:"Outlines,omitempty"`
Permissions *CT_Permission `xml:"Permissions,omitempty"`
Actions *ActionList `xml:"Actions,omitempty"`
VPreferences *CT_VPreferences `xml:"VPreferences,omitempty"`
Bookmarks *BookmarkList `xml:"Bookmarks,omitempty"`
Annotations *StLoc `xml:"Annotations,omitempty"`
CustomTags *StLoc `xml:"CustomTags,omitempty"`
Attachments *StLoc `xml:"Attachments,omitempty"`
Extensions *StLoc `xml:"Extensions,omitempty"`
}
type DrawParam ¶
type DrawParam struct {
ID StID `xml:"ID,attr"`
Relative StRefID `xml:"Relative,attr,omitempty"`
LineWidth float64 `xml:"LineWidth,attr,omitempty"`
Join string `xml:"Join,attr,omitempty"` // Miter, Round, Bevel
Cap string `xml:"Cap,attr,omitempty"` // Butt, Round, Square
DashOffset float64 `xml:"DashOffset,attr,omitempty"`
DashPattern *StArrayF `xml:"DashPattern,attr,omitempty"`
MiterLimit float64 `xml:"MiterLimit,attr,omitempty"`
FillColor *CTColor `xml:"FillColor"`
StrokeColor *CTColor `xml:"StrokeColor"`
}
type DrawParams ¶
type DrawParams struct {
DrawParam []*DrawParam `xml:"DrawParam"`
}
type Extension ¶
type Extension struct {
AppName string `xml:"AppName,attr"`
Company *string `xml:"Company,attr,omitempty"`
AppVersion *string `xml:"AppVersion,attr,omitempty"`
Date *time.Time `xml:"Date,attr,omitempty"`
RefID StRefID `xml:"RefId,attr"`
Properties []ExtensionProp `xml:"Property,omitempty"`
Data *interface{} `xml:"Data,omitempty"`
ExtendData *StLoc `xml:"ExtendData,omitempty"`
}
Extension 单个扩展定义
func (*Extension) MarshalXML ¶
MarshalXML 自定义Extension序列化(修正版)
func (*Extension) UnmarshalXML ¶
UnmarshalXML 自定义Extension解析
type ExtensionProp ¶
type ExtensionProp struct {
Name string `xml:"Name,attr"`
Type *string `xml:"Type,attr,omitempty"`
Value string `xml:",chardata"`
}
ExtensionProp 扩展属性
type Extensions ¶
type Extensions struct {
XMLName xml.Name `xml:"Extensions"`
Xmlns string `xml:"xmlns,attr"`
Extensions []Extension `xml:"Extension"`
}
Extensions 扩展列表容器
type Font ¶
type Font struct {
ID StID `xml:"ID,attr"`
FontName string `xml:"FontName,attr"`
FamilyName string `xml:"FamilyName,attr,omitempty"`
Charset string `xml:"Charset,attr,omitempty"` // symbol, prc, big5, shift-jis, wansung, johab, unicode
Italic bool `xml:"Italic,attr,omitempty"`
Bold bool `xml:"Bold,attr,omitempty"`
Serif bool `xml:"Serif,attr,omitempty"`
FixedWidth bool `xml:"FixedWidth,attr,omitempty"`
FontFile StLoc `xml:"FontFile,omitempty"`
}
type GouraudPoint ¶
type ImageObject ¶
type LaGouraudPoint ¶
type Layer ¶
type Layer struct {
ID StID `xml:"ID,attr"`
Type string `xml:"Type,attr,omitempty"` // Body, Background, Foreground, Custom
DrawParam StRefID `xml:"DrawParam,attr,omitempty"`
// CTPageBlock 内容
TextObject []TextObject `xml:"TextObject"`
PathObject []PathObject `xml:"PathObject"`
ImageObject []ImageObject `xml:"ImageObject"`
CompositeObject []CompositeObject `xml:"CompositeObject"`
PageBlock []PageBlock `xml:"PageBlock"`
}
type MovieOperator ¶
type MovieOperator string
MovieOperator 影片操作类型
const ( MovieOperatorPlay MovieOperator = "Play" MovieOperatorStop MovieOperator = "Stop" MovieOperatorPause MovieOperator = "Pause" MovieOperatorResume MovieOperator = "Resume" )
type MultiMedia ¶
type MultiMedias ¶
type MultiMedias struct {
MultiMedia []*MultiMedia `xml:"MultiMedia"`
}
type OFD ¶
type OFD struct {
XMLName xml.Name `xml:"OFD"`
XMLNS string `xml:"xmlns:ofd,attr"`
Version string `xml:"Version,attr"`
DocType string `xml:"DocType,attr"`
DocBodies []DocBody `xml:"DocBody"`
}
OFD 文档根元素
type OutlineList ¶
type OutlineList struct {
OutlineElems []CTOutlineElem `xml:"OutlineElem"`
}
type PageAnnot ¶
type PageAnnot struct {
XMLName xml.Name `xml:"PageAnnot"`
Xmlns string `xml:"xmlns,attr"`
Annots []*Annot `xml:"Annot"`
}
PageAnnot 页面注解容器
type PageBlock ¶
type PageBlock struct {
ID StID `xml:"ID,attr"`
CTPageBlock // 嵌入CT_PageBlock
}
type PageContent ¶
type PageContent struct {
Template []Template `xml:"Template"`
PageRes []StLoc `xml:"PageRes"`
Area *CtPageArea `xml:"Area"`
Content *Content `xml:"Content"`
Actions *Actions `xml:"Actions"`
}
type PageLayout ¶
type PageLayout string
const ( PageLayoutOneColumn PageLayout = "OneColumn" PageLayoutTwoPageL PageLayout = "TwoPageL" )
type Path ¶
type Path struct {
XMLName xml.Name
// 公共属性
Point1 *StPos `xml:"Point1,attr,omitempty"`
Point2 *StPos `xml:"Point2,attr,omitempty"`
Point3 *StPos `xml:"Point3,attr,omitempty"`
// Arc特有属性
SweepDirection *bool `xml:"SweepDirection,attr,omitempty"`
LargeArc *bool `xml:"LargeArc,attr,omitempty"`
RotationAngle *float64 `xml:"RotationAngle,attr,omitempty"`
EllipseSize *StArray `xml:"EllipseSize,attr,omitempty"`
EndPoint *StPos `xml:"EndPoint,attr,omitempty"`
}
Path 路径元素
type PathCommand ¶
type PathCommand struct {
Type CommandType
Points []StPos
Arc *ArcData // 仅当Type为ArcTo时有意义
}
PathCommand 定义路径命令
type PathObject ¶
type PrintSettings ¶
type References ¶
type Res ¶
type Res struct {
BaseLoc StLoc `xml:"BaseLoc,attr"`
ColorSpaces *ColorSpaces `xml:"ColorSpaces"`
DrawParams *DrawParams `xml:"DrawParams"`
Fonts *Fonts `xml:"Fonts"`
MultiMedias *MultiMedias `xml:"MultiMedias"`
CompositeGraphicUnits *CompositeGraphicUnits `xml:"CompositeGraphicUnits"`
}
type SVGPath ¶
type SVGPath []PathCommand
SVGPath 定义SVG路径,是PathCommand的切片类型 可以用于直接解析和编码XML
func ParsePathData ¶
ParsePathData 解析路径字符串为SVGPath (公开的工厂函数)
func (SVGPath) CalculateBoundingBox ¶
CalculateBoundingBox 计算边界框
func (SVGPath) CountCommands ¶
func (p SVGPath) CountCommands() map[CommandType]int
CountCommands 统计命令数量
func (SVGPath) GetCommand ¶
func (p SVGPath) GetCommand(index int) (PathCommand, error)
GetCommand 获取指定索引的命令
func (SVGPath) GetStartPoint ¶
GetStartPoint 获取指定命令的起始点(用于弧计算)
func (SVGPath) MarshalXML ¶
MarshalXML 实现xml.Marshaler接口
func (*SVGPath) UnmarshalXML ¶
UnmarshalXML 实现xml.Unmarshaler接口 支持解析如: <path>M 10 20 L 30 40</path>
type Signature ¶
type Signature struct {
SignedInfo SignedInfo `xml:"SignedInfo"`
SignedValue StLoc `xml:"SignedValue"`
}
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"`
}
Signatures 签名列表容器
type SignedInfo ¶
type SignedInfo struct {
Provider Provider `xml:"Provider"`
SignatureMethod string `xml:"SignatureMethod,omitempty"`
SignatureDateTime string `xml:"SignatureDateTime,omitempty"`
References References `xml:"References"`
StampAnnot []*StampAnnot `xml:"StampAnnot,omitempty"`
Seal *Seal `xml:"Seal,omitempty"`
}
type StArray ¶
type StArray []string
StArray 数组字符串类型
func (*StArray) MarshalXML ¶
MarshalXML 将StArray序列化为XML字符串
func (*StArray) UnmarshalXML ¶
UnmarshalXML 从XML字符串解析StArray
type StArrayF ¶
type StArrayF []float64
func (StArrayF) MarshalXML ¶
MarshalXML 实现 xml.Marshaler 接口
func (StArrayF) MarshalXMLAttr ¶
MarshalXMLAttr 实现 xml.MarshalerAttr 接口
func (*StArrayF) UnmarshalXML ¶
UnmarshalXML 实现 xml.Unmarshaler 接口
type StArrayI ¶
type StArrayI []int
func (StArrayI) MarshalXML ¶
MarshalXML 实现 xml.Marshaler 接口
func (StArrayI) MarshalXMLAttr ¶
MarshalXMLAttr 实现 xml.MarshalerAttr 接口
func (*StArrayI) UnmarshalXML ¶
UnmarshalXML 实现 xml.Unmarshaler 接口
type StBox ¶
type StBox struct {
X float64 `xml:"X,attr"`
Y float64 `xml:"Y,attr"`
Width float64 `xml:"Width,attr"`
Height float64 `xml:"Height,attr"`
}
StBox 盒子区域定义 (X Y Width Height)
func (*StBox) CopyAndShift ¶ added in v0.0.2
func (*StBox) MarshalXML ¶
MarshalXML 自定义XML序列化方法
func (*StBox) UnmarshalXML ¶
UnmarshalXML 自定义XML元素解析方法
type StPos ¶
StPos 位置坐标类型
func (*StPos) MarshalXML ¶
MarshalXML 将 StPos 序列化为 XML 字符串
func (*StPos) UnmarshalXML ¶
UnmarshalXML 从 XML 字符串解析 StPos
type StampAnnot ¶
type TabDisplay ¶
type TabDisplay string
const ( TabDisplayDocTitle TabDisplay = "DocTitle" TabDisplayFileName TabDisplay = "FileName" )
type TemplatePage ¶
type TextObject ¶
type ValidPeriod ¶
type Version ¶
type Version struct {
ID string `xml:"ID,attr"`
Index int `xml:"Index,attr"`
Current bool `xml:"Current,attr"`
BaseLoc StLoc `xml:"BaseLoc,attr"`
}
Version 文档版本
type VersionFile ¶
VersionFile 版本文件