Documentation
¶
Overview ¶
Package manifest 负责读取声明式 manifest 并构建 OFD 文档模型。
Index ¶
- Variables
- type Action
- type ActionArea
- type ActionRegion
- type Annotation
- type AnnotationPage
- type AnnotationParameter
- type Attachment
- type AxialShading
- type Binding
- type Bookmark
- type Box
- type BuildOptions
- type CGTransform
- type CaptionStyle
- type Clip
- type ClipArea
- type ClipPath
- type ClipText
- type Color
- type ColorSpace
- type ColorStop
- type Composite
- type CustomData
- type CustomTag
- type DetailColumn
- type DetailPagination
- type Document
- type DrawParam
- type Extension
- type ExtensionProperty
- type FieldDoc
- type Flow
- type FlowBlock
- type FlowCellBorders
- type FlowCellStyle
- type FlowColumns
- type FlowFixed
- type FlowFontFamily
- type FlowFootnote
- type FlowImage
- type FlowMargins
- type FlowNamedStyle
- type FlowOfficial
- type FlowOfficialColophon
- type FlowOfficialFonts
- type FlowOfficialLetterhead
- type FlowOfficialSignature
- type FlowRun
- type FlowSection
- type FlowSectionSize
- type FlowStyle
- type FlowTOC
- type FlowTable
- type FlowTableBorder
- type FlowTableCell
- type FlowTableColumn
- type Font
- type GotoAAction
- type GotoAction
- type Gouraud
- type GouraudPoint
- type Image
- type ImageBorder
- type Item
- type LaGouraud
- type LaGouraudPoint
- type Layer
- type Manifest
- func (m Manifest) Build(baseDir, assetRoot string) (creator.Document, error)
- func (m Manifest) BuildWithOptions(baseDir, assetRoot string, options BuildOptions) (creator.Document, error)
- func (m Manifest) RenderTemplate(data io.Reader, baseDir, assetRoot string, opts TemplateOptions) (creator.Document, error)
- type Media
- type MovieAction
- type Outline
- type Page
- type PageArea
- type PageImage
- type PageResource
- type PageSize
- type PageVariant
- type PageVariants
- type Pattern
- type Permissions
- type Point
- type Preferences
- type PrintSettings
- type PublicResource
- type RadialShading
- type RegionCommand
- type ResourceFile
- type Resources
- type Signature
- type SignatureReference
- type SignatureStamp
- type SoundAction
- type TableCell
- type TableRow
- type TableStyle
- type Template
- type TemplateOptions
- type TemplateRef
- type TextCode
- type TypeDoc
- type URIAction
- type ValidPeriod
- type Version
- type VersionFile
Constants ¶
This section is empty.
Variables ¶
var SchemaDocs = []TypeDoc{ {Name: "Manifest", Path: "", Doc: "是 ofd-creator 支持的声明式输入文件。", Fields: []FieldDoc{ {Name: "version", Type: "int", Doc: "指定 manifest 格式版本。", Optional: true}, {Name: "document", Type: "Document", Doc: "定义文档主体及其元数据。", Optional: false}, {Name: "resources", Type: "Resources", Doc: "汇总文档级资源。", Optional: false}, {Name: "templates", Type: "[]Template", Doc: "定义可供页面引用的模板页。", Optional: true}, {Name: "pages", Type: "[]Page", Doc: "定义文档页面。", Optional: true}, {Name: "flow", Type: "*Flow", Doc: "按顺序排版内容,自动生成标准 OFD 页面;与 pages 互斥。", Optional: true}, }}, {Name: "Document", Path: "document", Doc: "描述 OFD 文档及其元数据、资源和页面内容。", Fields: []FieldDoc{ {Name: "id", Type: "string", Doc: "标识文档。", Optional: true}, {Name: "title", Type: "string", Doc: "记录文档标题。", Optional: true}, {Name: "author", Type: "string", Doc: "记录文档作者。", Optional: true}, {Name: "subject", Type: "string", Doc: "记录文档主题。", Optional: true}, {Name: "abstract", Type: "string", Doc: "记录文档摘要。", Optional: true}, {Name: "creator", Type: "string", Doc: "记录创建文档的应用名称。", Optional: true}, {Name: "creator_version", Type: "string", Doc: "记录创建应用的版本。", Optional: true}, {Name: "page_size", Type: "PageSize", Doc: "定义默认页面尺寸。", Optional: false}, {Name: "actions", Type: "[]Action", Doc: "定义文档级动作。", Optional: true}, {Name: "bookmarks", Type: "[]Bookmark", Doc: "定义文档书签。", Optional: true}, {Name: "attachments", Type: "[]Attachment", Doc: "定义文档附件。", Optional: true}, {Name: "extensions", Type: "[]Extension", Doc: "定义文档扩展信息。", Optional: true}, {Name: "versions", Type: "[]Version", Doc: "定义文档版本记录。", Optional: true}, {Name: "annotations", Type: "[]AnnotationPage", Doc: "定义按页面组织的批注。", Optional: true}, {Name: "doc_usage", Type: "string", Doc: "说明文档用途。", Optional: true}, {Name: "keywords", Type: "[]string", Doc: "记录文档关键词。", Optional: true}, {Name: "custom_data", Type: "[]CustomData", Doc: "定义文档自定义键值数据。", Optional: true}, {Name: "cover", Type: "string", Doc: "指定封面文件路径。", Optional: true}, {Name: "cover_base64", Type: "string", Doc: "提供 Base64 编码的封面数据。", Optional: true}, {Name: "cover_name", Type: "string", Doc: "指定封面在文档中的名称。", Optional: true}, {Name: "doc_type", Type: "string", Doc: "指定 OFD.xml 根节点的 DocType 取值,决定文档遵循的 profile。\n留空或 \"OFD\" 为 GB/T 33190—2016 的基础 profile;\"OFD-A\" 是\nGB/T 42133—2022《信息技术 OFD档案应用指南》规定的档案长期保存 profile,\n\"OFD-H\" 是 GB/T 48666-2026《电子病历版式文档技术要求》\n规定的电子病历 profile。取值区分大小写,未知取值在生成阶段报错。", Optional: true}, {Name: "creation_date", Type: "string", Doc: "记录文档创建时间。", Optional: true}, {Name: "mod_date", Type: "string", Doc: "记录文档最后修改时间。", Optional: true}, {Name: "area", Type: "*PageArea", Doc: "定义文档页面区域。", Optional: true}, {Name: "default_cs", Type: "uint64", Doc: "指定文档默认颜色空间编号。", Optional: true}, {Name: "preferences", Type: "*Preferences", Doc: "定义文档查看偏好。", Optional: true}, {Name: "permissions", Type: "*Permissions", Doc: "定义文档访问和操作权限。", Optional: true}, {Name: "outlines", Type: "[]Outline", Doc: "定义文档大纲。", Optional: true}, {Name: "signatures", Type: "[]Signature", Doc: "定义文档数字签名。", Optional: true}, }}, {Name: "Resources", Path: "resources", Doc: "汇总文档级资源。", Fields: []FieldDoc{ {Name: "fonts", Type: "[]Font", Doc: "汇总字体资源。", Optional: true}, {Name: "images", Type: "[]Image", Doc: "汇总图像资源。", Optional: true}, {Name: "media", Type: "[]Media", Doc: "汇总媒体资源。", Optional: true}, {Name: "color_spaces", Type: "[]ColorSpace", Doc: "汇总颜色空间资源。", Optional: true}, {Name: "draw_params", Type: "[]DrawParam", Doc: "汇总图形绘制参数。", Optional: true}, {Name: "composites", Type: "[]Composite", Doc: "汇总复合图形单元资源。", Optional: true}, {Name: "public", Type: "[]PublicResource", Doc: "汇总公共资源。", Optional: true}, {Name: "custom_tags", Type: "[]CustomTag", Doc: "汇总自定义标签资源。", Optional: true}, }}, {Name: "Template", Path: "templates[]", Doc: "描述可供页面引用的模板页。", Fields: []FieldDoc{ {Name: "id", Type: "uint64", Doc: "标识模板页。", Optional: true}, {Name: "name", Type: "string", Doc: "指定模板页名称。", Optional: true}, {Name: "z_order", Type: "string", Doc: "指定模板页的层叠顺序。", Optional: true}, {Name: "layers", Type: "[]Layer", Doc: "定义模板页图层。", Optional: true}, {Name: "items", Type: "[]Item", Doc: "定义模板页图元。", Optional: true}, {Name: "area", Type: "*PageArea", Doc: "定义模板页区域。", Optional: true}, }}, {Name: "Page", Path: "pages[]", Doc: "描述文档页面及其图层、图元和页面资源。", Fields: []FieldDoc{ {Name: "repeat", Type: "string", Doc: "是模板渲染时从根数据读取的数组路径;每条记录生成一页,空数组不生成本页。", Optional: true}, {Name: "paginate", Type: "*DetailPagination", Doc: "将当前记录中的明细数组按固定区域容量分页,可与 repeat 组合。", Optional: true}, {Name: "variants", Type: "*PageVariants", Doc: "为明细分页选择首页、续页、末页或单页附加版式;仅与 paginate 配合使用。", Optional: true}, {Name: "templates", Type: "[]TemplateRef", Doc: "指定页面引用的模板页。", Optional: true}, {Name: "layers", Type: "[]Layer", Doc: "定义页面图层。", Optional: true}, {Name: "items", Type: "[]Item", Doc: "定义页面图元。", Optional: true}, {Name: "area", Type: "*PageArea", Doc: "定义页面区域。", Optional: true}, {Name: "layer_type", Type: "string", Doc: "指定页面图层类型。", Optional: true}, {Name: "actions", Type: "[]Action", Doc: "定义页面级动作。", Optional: true}, {Name: "resources", Type: "[]PageResource", Doc: "定义页面级资源。", Optional: true}, }}, {Name: "Flow", Path: "flow", Doc: "定义流式创作设置;页面尺寸取 document.page_size,字体取 resources.fonts。", Fields: []FieldDoc{ {Name: "profile", Type: "string", Doc: "选择专用版式,支持 gbt9704;与 theme 互斥,需同时提供 official.fonts。", Optional: true}, {Name: "official", Type: "*FlowOfficial", Doc: "是 GB/T 9704—2012 常规公文的字体、版头、落款与版记配置。", Optional: true}, {Name: "theme", Type: "string", Doc: "选择 material(默认)、material2、material3、fluent2、carbon 或 bootstrap5 印刷主题;字体资源仍由 font、heading_font 等字段配置。", Optional: true}, {Name: "columns", Type: "*FlowColumns", Doc: "配置等宽分栏,省略时单栏。", Optional: true}, {Name: "styles", Type: "[]FlowNamedStyle", Doc: "注册命名文字样式,可由块或单元格 style.based_on 引用。", Optional: true}, {Name: "footnotes", Type: "[]FlowFootnote", Doc: "注册页底注释,按正文、列表或表格中的首次引用顺序编号。", Optional: true}, {Name: "footnote_style", Type: "*FlowStyle", Doc: "覆盖默认脚注样式(9pt、1.3 倍行高),支持 based_on。", Optional: true}, {Name: "font", Type: "string", Doc: "指定正文、图注与表格的字体资源名,缺省使用内置 Go 字体。", Optional: true}, {Name: "heading_font", Type: "string", Doc: "指定标题字体,缺省继承显式 font,否则使用内置 Go 粗体。", Optional: true}, {Name: "bold_font", Type: "string", Doc: "是正文字体族粗体的简写,font_families 中的显式族关系优先。", Optional: true}, {Name: "italic_font", Type: "string", Doc: "是正文字体族斜体的简写。", Optional: true}, {Name: "bold_italic_font", Type: "string", Doc: "是正文字体族粗斜体的简写。", Optional: true}, {Name: "fallback_fonts", Type: "[]string", Doc: "是按字符覆盖依次尝试的回退字体资源名。", Optional: true}, {Name: "font_faces", Type: "map[string]int", Doc: "按字体资源名选择 TTC/OTC 中从 0 开始的字体面,缺省为 0,单字体文件只接受 0。", Optional: true}, {Name: "font_families", Type: "[]FlowFontFamily", Doc: "显式关联同一字体族的实际字体资源,字重与斜体在各自字体族内匹配。", Optional: true}, {Name: "margins", Type: "*FlowMargins", Doc: "定义毫米单位的页边距,省略时四边均为 20mm。", Optional: true}, {Name: "body_size", Type: "float64", Doc: "是正文字号,单位磅,省略时沿用主题(fluent2 为 10.5,其余普通主题为 12)。", Optional: true}, {Name: "line_height", Type: "float64", Doc: "是正文行高倍率,省略时沿用主题(material 为 1.6,fluent2 为 20/14,其余普通主题为 1.5)。", Optional: true}, {Name: "page_numbers", Type: "*bool", Doc: "控制页码显示;省略或 null 时普通主题默认关闭,gbt9704 默认开启,显式 false 可关闭。", Optional: true}, {Name: "header", Type: "string", Doc: "是页眉文字,支持 {page} 与 {pages} 占位符,上页边距须至少 8mm。", Optional: true}, {Name: "footer", Type: "string", Doc: "是页脚文字,支持页码占位符;page_numbers 为真时在其后追加页码。", Optional: true}, {Name: "generate_outlines", Type: "bool", Doc: "按标题层级生成标准大纲,追加在 document.outlines 后,跳转位置由最终分页确定。", Optional: true}, {Name: "reference_page_numbers", Type: "string", Doc: "选择目录与 page_ref 使用 physical(默认物理页码)或 section(节内显示页码)。", Optional: true}, {Name: "blocks", Type: "[]FlowBlock", Doc: "是按顺序排列的逻辑内容。", Optional: true}, }}, {Name: "PageSize", Path: "document.page_size", Doc: "描述文档页面尺寸。", Fields: []FieldDoc{ {Name: "name", Type: "string", Doc: "指定预定义页面尺寸名称。", Optional: true}, {Name: "width", Type: "float64", Doc: "指定页面宽度。", Optional: true}, {Name: "height", Type: "float64", Doc: "指定页面高度。", Optional: true}, }}, {Name: "Action", Path: "document.actions[]", Doc: "描述文档、页面或图元触发的动作。", Fields: []FieldDoc{ {Name: "event", Type: "string", Doc: "指定触发动作的事件。", Optional: true}, {Name: "region", Type: "*ActionRegion", Doc: "定义动作触发区域。", Optional: true}, {Name: "uri", Type: "*URIAction", Doc: "定义打开或跳转到 URI 的动作。", Optional: true}, {Name: "goto", Type: "*GotoAction", Doc: "定义跳转到页面或位置的动作。", Optional: true}, {Name: "goto_a", Type: "*GotoAAction", Doc: "定义跳转到附件的动作。", Optional: true}, {Name: "sound", Type: "*SoundAction", Doc: "定义播放声音资源的动作。", Optional: true}, {Name: "movie", Type: "*MovieAction", Doc: "定义播放媒体资源的动作。", Optional: true}, }}, {Name: "Bookmark", Path: "document.bookmarks[]", Doc: "描述文档书签及其跳转目标。", Fields: []FieldDoc{ {Name: "name", Type: "string", Doc: "指定书签名称。", Optional: true}, {Name: "goto", Type: "GotoAction", Doc: "指定书签跳转目标。", Optional: true}, }}, {Name: "Attachment", Path: "document.attachments[]", Doc: "描述文档附件。", Fields: []FieldDoc{ {Name: "id", Type: "string", Doc: "标识附件。", Optional: true}, {Name: "name", Type: "string", Doc: "指定附件名称。", Optional: true}, {Name: "format", Type: "string", Doc: "指定附件格式。", Optional: true}, {Name: "usage", Type: "string", Doc: "说明附件用途。", Optional: true}, {Name: "file", Type: "string", Doc: "指定附件文件路径。", Optional: true}, {Name: "data_base64", Type: "string", Doc: "提供 Base64 编码的附件数据。", Optional: true}, {Name: "file_name", Type: "string", Doc: "指定附件在文档中的文件名。", Optional: true}, {Name: "creation_date", Type: "string", Doc: "记录附件创建时间。", Optional: true}, {Name: "mod_date", Type: "string", Doc: "记录附件最后修改时间。", Optional: true}, {Name: "visible", Type: "*bool", Doc: "指示附件是否可见。", Optional: true}, }}, {Name: "Extension", Path: "document.extensions[]", Doc: "描述文档扩展信息。", Fields: []FieldDoc{ {Name: "app_name", Type: "string", Doc: "指定扩展信息来源应用名称。", Optional: true}, {Name: "company", Type: "string", Doc: "指定扩展信息来源公司。", Optional: true}, {Name: "app_version", Type: "string", Doc: "指定来源应用版本。", Optional: true}, {Name: "date", Type: "string", Doc: "记录扩展信息生成时间。", Optional: true}, {Name: "ref_id", Type: "uint64", Doc: "指定扩展信息引用标识。", Optional: true}, {Name: "data", Type: "string", Doc: "指定扩展数据。", Optional: true}, {Name: "data_xml", Type: "string", Doc: "指定扩展 XML 数据。", Optional: true}, {Name: "data_file", Type: "string", Doc: "指定扩展数据文件路径。", Optional: true}, {Name: "data_file_base64", Type: "string", Doc: "提供 Base64 编码的扩展文件数据。", Optional: true}, {Name: "data_name", Type: "string", Doc: "指定扩展数据文件名称。", Optional: true}, {Name: "properties", Type: "[]ExtensionProperty", Doc: "定义扩展属性。", Optional: true}, }}, {Name: "Version", Path: "document.versions[]", Doc: "描述文档的一个版本。", Fields: []FieldDoc{ {Name: "id", Type: "string", Doc: "标识文档版本。", Optional: true}, {Name: "index", Type: "int", Doc: "指定版本序号。", Optional: true}, {Name: "current", Type: "bool", Doc: "指示是否为当前版本。", Optional: true}, {Name: "version", Type: "string", Doc: "指定版本号。", Optional: false}, {Name: "name", Type: "string", Doc: "指定版本名称。", Optional: true}, {Name: "creation_date", Type: "string", Doc: "记录版本创建时间。", Optional: true}, {Name: "doc_root", Type: "string", Doc: "指定版本文档根文件路径。", Optional: true}, {Name: "doc_root_base64", Type: "string", Doc: "提供 Base64 编码的版本文档根数据。", Optional: true}, {Name: "doc_root_name", Type: "string", Doc: "指定版本文档根文件名称。", Optional: true}, {Name: "files", Type: "[]VersionFile", Doc: "定义版本包含的文件。", Optional: true}, }}, {Name: "AnnotationPage", Path: "document.annotations[]", Doc: "描述某一页面上的批注集合。", Fields: []FieldDoc{ {Name: "page", Type: "int", Doc: "指定批注所属页码。", Optional: true}, {Name: "items", Type: "[]Annotation", Doc: "定义该页面上的批注。", Optional: true}, }}, {Name: "CustomData", Path: "document.custom_data[]", Doc: "描述文档自定义键值数据。", Fields: []FieldDoc{ {Name: "name", Type: "string", Doc: "指定自定义数据名称。", Optional: true}, {Name: "value", Type: "string", Doc: "指定自定义数据值。", Optional: true}, }}, {Name: "PageArea", Path: "document.area", Doc: "描述页面的物理、应用、内容和出血区域。", Fields: []FieldDoc{ {Name: "physical_box", Type: "*Box", Doc: "定义页面物理区域。", Optional: true}, {Name: "application_box", Type: "*Box", Doc: "定义页面应用区域。", Optional: true}, {Name: "content_box", Type: "*Box", Doc: "定义页面内容区域。", Optional: true}, {Name: "bleed_box", Type: "*Box", Doc: "定义页面出血区域。", Optional: true}, }}, {Name: "Preferences", Path: "document.preferences", Doc: "描述文档查看偏好设置。", Fields: []FieldDoc{ {Name: "page_mode", Type: "string", Doc: "指定页面显示模式。", Optional: true}, {Name: "page_layout", Type: "string", Doc: "指定页面布局方式。", Optional: true}, {Name: "tab_display", Type: "string", Doc: "指定文档标签页显示方式。", Optional: true}, {Name: "hide_toolbar", Type: "*bool", Doc: "指示是否隐藏工具栏。", Optional: true}, {Name: "hide_menubar", Type: "*bool", Doc: "指示是否隐藏菜单栏。", Optional: true}, {Name: "hide_window_ui", Type: "*bool", Doc: "指示是否隐藏窗口界面元素。", Optional: true}, {Name: "zoom_mode", Type: "string", Doc: "指定缩放模式。", Optional: true}, {Name: "zoom", Type: "*float64", Doc: "指定页面缩放比例。", Optional: true}, }}, {Name: "Permissions", Path: "document.permissions", Doc: "描述文档的访问和操作权限。", Fields: []FieldDoc{ {Name: "edit", Type: "*bool", Doc: "指示是否允许编辑文档。", Optional: true}, {Name: "annot", Type: "*bool", Doc: "指示是否允许添加或修改批注。", Optional: true}, {Name: "export", Type: "*bool", Doc: "指示是否允许导出文档。", Optional: true}, {Name: "signature", Type: "*bool", Doc: "指示是否允许签名。", Optional: true}, {Name: "watermark", Type: "*bool", Doc: "指示是否允许修改水印。", Optional: true}, {Name: "print_screen", Type: "*bool", Doc: "指示是否允许屏幕截图。", Optional: true}, {Name: "print", Type: "*PrintSettings", Doc: "定义打印权限和设置。", Optional: true}, {Name: "valid_period", Type: "*ValidPeriod", Doc: "定义权限的有效时间范围。", Optional: true}, }}, {Name: "Outline", Path: "document.outlines[]", Doc: "描述文档大纲节点及其子节点。", Fields: []FieldDoc{ {Name: "title", Type: "string", Doc: "指定大纲节点标题。", Optional: true}, {Name: "count", Type: "*int", Doc: "指定大纲节点包含的条目数。", Optional: true}, {Name: "expanded", Type: "*bool", Doc: "指示大纲节点是否展开。", Optional: true}, {Name: "actions", Type: "[]Action", Doc: "定义大纲节点动作。", Optional: true}, {Name: "children", Type: "[]Outline", Doc: "定义大纲子节点。", Optional: true}, }}, {Name: "Signature", Path: "document.signatures[]", Doc: "描述文档数字签名。", Fields: []FieldDoc{ {Name: "id", Type: "string", Doc: "标识数字签名。", Optional: true}, {Name: "type", Type: "string", Doc: "指定签名类型。", Optional: true}, {Name: "provider_name", Type: "string", Doc: "指定签名提供方名称。", Optional: true}, {Name: "provider_version", Type: "string", Doc: "指定签名提供方版本。", Optional: true}, {Name: "company", Type: "string", Doc: "指定签名提供方公司。", Optional: true}, {Name: "method", Type: "string", Doc: "指定签名方法。", Optional: true}, {Name: "date", Type: "string", Doc: "记录签名时间。", Optional: true}, {Name: "check_method", Type: "string", Doc: "指定签名校验方法。", Optional: true}, {Name: "references", Type: "[]SignatureReference", Doc: "定义签名引用及其校验值。", Optional: true}, {Name: "stamp_annots", Type: "[]SignatureStamp", Doc: "定义签名盖章区域。", Optional: true}, {Name: "seal_file", Type: "string", Doc: "指定印章文件路径。", Optional: true}, {Name: "seal_file_base64", Type: "string", Doc: "提供 Base64 编码的印章数据。", Optional: true}, {Name: "seal_name", Type: "string", Doc: "指定印章文件名称。", Optional: true}, {Name: "signed_value", Type: "string", Doc: "提供 Base64 编码的签名值。", Optional: true}, {Name: "signed_value_name", Type: "string", Doc: "指定签名值文件名称。", Optional: true}, }}, {Name: "Font", Path: "resources.fonts[]", Doc: "描述文档使用的字体资源。", Fields: []FieldDoc{ {Name: "name", Type: "string", Doc: "指定文档内唯一的字体资源引用名,与文字的 font 字段对应。", Optional: true}, {Name: "font_name", Type: "string", Doc: "指定 OFD 中的实际字型名;省略时普通创建使用 name,flow 从嵌入字体自动补全。", Optional: true}, {Name: "family_name", Type: "string", Doc: "指定字体族名称。", Optional: true}, {Name: "charset", Type: "string", Doc: "指定字体字符集。", Optional: true}, {Name: "format", Type: "string", Doc: "指定字体文件格式。", Optional: true}, {Name: "file", Type: "string", Doc: "指定字体文件路径。", Optional: true}, {Name: "data_base64", Type: "string", Doc: "提供 Base64 编码的字体数据。", Optional: true}, {Name: "italic", Type: "bool", Doc: "指示字体是否为斜体。", Optional: true}, {Name: "bold", Type: "bool", Doc: "指示字体是否为粗体。", Optional: true}, {Name: "serif", Type: "bool", Doc: "指示字体是否为衬线字体。", Optional: true}, {Name: "fixed_width", Type: "bool", Doc: "指示字体是否为等宽字体。", Optional: true}, }}, {Name: "Image", Path: "resources.images[]", Doc: "描述文档中的图像资源。", Fields: []FieldDoc{ {Name: "id", Type: "uint64", Doc: "标识图像资源。", Optional: true}, {Name: "format", Type: "string", Doc: "指定图像格式。", Optional: true}, {Name: "name", Type: "string", Doc: "指定图像名称。", Optional: true}, {Name: "file", Type: "string", Doc: "指定图像文件路径。", Optional: true}, {Name: "data_base64", Type: "string", Doc: "提供 Base64 编码的图像数据。", Optional: true}, }}, {Name: "Media", Path: "resources.media[]", Doc: "描述文档中的媒体资源。", Fields: []FieldDoc{ {Name: "id", Type: "uint64", Doc: "标识媒体资源。", Optional: true}, {Name: "type", Type: "string", Doc: "指定媒体类型。", Optional: true}, {Name: "format", Type: "string", Doc: "指定媒体格式。", Optional: true}, {Name: "name", Type: "string", Doc: "指定媒体名称。", Optional: true}, {Name: "file", Type: "string", Doc: "指定媒体文件路径。", Optional: true}, {Name: "data_base64", Type: "string", Doc: "提供 Base64 编码的媒体数据。", Optional: true}, }}, {Name: "ColorSpace", Path: "resources.color_spaces[]", Doc: "描述文档使用的颜色空间资源。", Fields: []FieldDoc{ {Name: "id", Type: "uint64", Doc: "标识颜色空间资源。", Optional: true}, {Name: "type", Type: "string", Doc: "指定颜色空间类型。", Optional: true}, {Name: "bits_per_component", Type: "int", Doc: "指定每个颜色分量的位数。", Optional: true}, {Name: "palette", Type: "[]string", Doc: "定义颜色索引到颜色分量的映射。", Optional: true}, {Name: "profile_file", Type: "string", Doc: "指定颜色配置文件路径。", Optional: true}, {Name: "profile_base64", Type: "string", Doc: "提供 Base64 编码的颜色配置数据。", Optional: true}, {Name: "profile_name", Type: "string", Doc: "指定颜色配置文件名称。", Optional: true}, }}, {Name: "DrawParam", Path: "resources.draw_params[]", Doc: "描述图形绘制参数。", Fields: []FieldDoc{ {Name: "name", Type: "string", Doc: "指定绘制参数名称。", Optional: true}, {Name: "relative", Type: "string", Doc: "指定参数相对的坐标或对象。", Optional: true}, {Name: "line_width", Type: "float64", Doc: "指定线宽。", Optional: true}, {Name: "join", Type: "string", Doc: "指定线段连接样式。", Optional: true}, {Name: "cap", Type: "string", Doc: "指定线段端点样式。", Optional: true}, {Name: "dash_offset", Type: "float64", Doc: "指定虚线起始偏移量。", Optional: true}, {Name: "dash_pattern", Type: "[]float64", Doc: "指定虚线长度模式。", Optional: true}, {Name: "miter_limit", Type: "float64", Doc: "指定斜接长度限制。", Optional: true}, {Name: "fill_color", Type: "*Color", Doc: "指定填充颜色。", Optional: true}, {Name: "stroke_color", Type: "*Color", Doc: "指定描边颜色。", Optional: true}, }}, {Name: "Composite", Path: "resources.composites[]", Doc: "描述复合图形单元资源。", Fields: []FieldDoc{ {Name: "id", Type: "uint64", Doc: "标识复合图形单元。", Optional: true}, {Name: "width", Type: "float64", Doc: "指定复合图形宽度。", Optional: true}, {Name: "height", Type: "float64", Doc: "指定复合图形高度。", Optional: true}, {Name: "thumbnail", Type: "uint64", Doc: "指定缩略图资源编号。", Optional: true}, {Name: "substitution", Type: "uint64", Doc: "指定替代图形资源编号。", Optional: true}, {Name: "items", Type: "[]Item", Doc: "定义复合图形中的图元。", Optional: true}, }}, {Name: "PublicResource", Path: "resources.public[]", Doc: "描述文档中的公共资源。", Fields: []FieldDoc{ {Name: "name", Type: "string", Doc: "指定公共资源名称。", Optional: true}, {Name: "file", Type: "string", Doc: "指定公共资源文件路径。", Optional: true}, {Name: "data_base64", Type: "string", Doc: "提供 Base64 编码的公共资源数据。", Optional: true}, {Name: "files", Type: "[]ResourceFile", Doc: "定义公共资源包中的文件。", Optional: true}, }}, {Name: "CustomTag", Path: "resources.custom_tags[]", Doc: "描述文档自定义标签及其架构和数据。", Fields: []FieldDoc{ {Name: "name_space", Type: "string", Doc: "指定自定义标签命名空间。", Optional: true}, {Name: "schema", Type: "string", Doc: "指定架构文件路径。", Optional: true}, {Name: "schema_base64", Type: "string", Doc: "提供 Base64 编码的架构数据。", Optional: true}, {Name: "schema_name", Type: "string", Doc: "指定架构在文档中的名称。", Optional: true}, {Name: "data", Type: "string", Doc: "指定自定义数据文件路径或文本数据。", Optional: true}, {Name: "data_base64", Type: "string", Doc: "提供 Base64 编码的自定义数据。", Optional: true}, {Name: "data_name", Type: "string", Doc: "指定自定义数据在文档中的名称。", Optional: true}, }}, {Name: "Layer", Path: "templates[].layers[]", Doc: "描述页面或模板中的图层。", Fields: []FieldDoc{ {Name: "type", Type: "string", Doc: "指定图层类型。", Optional: true}, {Name: "draw_param", Type: "string", Doc: "指定图层使用的绘制参数名称。", Optional: true}, {Name: "items", Type: "[]Item", Doc: "定义图层中的图元。", Optional: true}, }}, {Name: "Item", Path: "templates[].items[]", Doc: "描述页面、模板或复合图形中的图元。", Fields: []FieldDoc{ {Name: "bind", Type: "*Binding", Doc: "定义 text/image 图元的数据绑定,仅在模板渲染时展开。", Optional: true}, {Name: "type", Type: "string", Doc: "指定图元类型。", Optional: true}, {Name: "x", Type: "float64", Doc: "指定图元左上角横坐标。", Optional: true}, {Name: "y", Type: "float64", Doc: "指定图元左上角纵坐标。", Optional: true}, {Name: "width", Type: "float64", Doc: "指定图元宽度。", Optional: true}, {Name: "height", Type: "float64", Doc: "指定图元高度。", Optional: true}, {Name: "value", Type: "string", Doc: "指定图元文本或其他值。", Optional: true}, {Name: "font", Type: "string", Doc: "指定文本图元使用的字体名称。", Optional: true}, {Name: "size", Type: "float64", Doc: "指定文本字号。", Optional: true}, {Name: "data", Type: "string", Doc: "指定图元数据或文件路径。", Optional: true}, {Name: "data_base64", Type: "string", Doc: "提供 Base64 编码的图元数据。", Optional: true}, {Name: "format", Type: "string", Doc: "指定图元数据格式。", Optional: true}, {Name: "name", Type: "string", Doc: "指定图元名称。", Optional: true}, {Name: "visible", Type: "*bool", Doc: "指示图元是否可见。", Optional: true}, {Name: "resource_id", Type: "uint64", Doc: "指定图元引用的资源编号。", Optional: true}, {Name: "stroke", Type: "bool", Doc: "指示是否绘制轮廓线。", Optional: true}, {Name: "fill", Type: "*bool", Doc: "指示是否填充图元。", Optional: true}, {Name: "stroke_set", Type: "*bool", Doc: "指示是否显式设置描边属性。", Optional: true}, {Name: "rule", Type: "string", Doc: "指定填充规则。", Optional: true}, {Name: "line_width", Type: "float64", Doc: "指定描边线宽。", Optional: true}, {Name: "cap", Type: "string", Doc: "指定描边端点样式。", Optional: true}, {Name: "join", Type: "string", Doc: "指定描边连接样式。", Optional: true}, {Name: "miter_limit", Type: "float64", Doc: "指定斜接长度限制。", Optional: true}, {Name: "dash_offset", Type: "float64", Doc: "指定虚线起始偏移量。", Optional: true}, {Name: "dash_pattern", Type: "[]float64", Doc: "指定虚线长度模式。", Optional: true}, {Name: "alpha", Type: "*uint8", Doc: "指定图元透明度。", Optional: true}, {Name: "draw_param", Type: "string", Doc: "指定图元使用的绘制参数名称。", Optional: true}, {Name: "ctm", Type: "[]float64", Doc: "指定图元的坐标变换矩阵。", Optional: true}, {Name: "fill_color", Type: "*Color", Doc: "指定填充颜色。", Optional: true}, {Name: "stroke_color", Type: "*Color", Doc: "指定描边颜色。", Optional: true}, {Name: "text_codes", Type: "[]TextCode", Doc: "定义文本代码及其定位信息。", Optional: true}, {Name: "cg_transforms", Type: "[]CGTransform", Doc: "定义文本代码到字形的映射。", Optional: true}, {Name: "actions", Type: "[]Action", Doc: "定义图元触发的动作。", Optional: true}, {Name: "items", Type: "[]Item", Doc: "定义复合或页面块图元的子图元。", Optional: true}, {Name: "h_scale", Type: "float64", Doc: "指定文本水平方向缩放比例。", Optional: true}, {Name: "read_direction", Type: "int", Doc: "指定文本阅读方向。", Optional: true}, {Name: "char_direction", Type: "int", Doc: "指定字符排列方向。", Optional: true}, {Name: "weight", Type: "int", Doc: "指定文本字重。", Optional: true}, {Name: "italic", Type: "bool", Doc: "指示文本是否为斜体。", Optional: true}, {Name: "clips", Type: "[]Clip", Doc: "定义图元裁剪区域。", Optional: true}, {Name: "substitution", Type: "uint64", Doc: "指定图像替代资源编号。", Optional: true}, {Name: "image_mask", Type: "uint64", Doc: "指定图像掩码资源编号。", Optional: true}, {Name: "border", Type: "*ImageBorder", Doc: "定义图像边框样式。", Optional: true}, {Name: "rows", Type: "[]TableRow", Doc: "定义表格行(仅当 type 为 \"table\" 时有效)。", Optional: true}, {Name: "column_widths", Type: "[]float64", Doc: "定义各列宽度(仅当 type 为 \"table\" 时有效)。", Optional: true}, {Name: "header_rows", Type: "int", Doc: "定义表头行数(仅当 type 为 \"table\" 时有效)。", Optional: true}, {Name: "style", Type: "*TableStyle", Doc: "定义表格样式(仅当 type 为 \"table\" 时有效)。", Optional: true}, {Name: "caption", Type: "string", Doc: "定义表题文字(仅当 type 为 \"table\" 时有效)。", Optional: true}, {Name: "caption_style", Type: "*CaptionStyle", Doc: "定义表题样式(仅当 type 为 \"table\" 时有效)。", Optional: true}, {Name: "continuation_caption", Type: "string", Doc: "定义续表题文字(仅当 type 为 \"table\" 时有效)。", Optional: true}, {Name: "continuation_caption_style", Type: "*CaptionStyle", Doc: "定义续表题样式(仅当 type 为 \"table\" 时有效)。", Optional: true}, {Name: "align", Type: "string", Doc: "指定图片与说明文字共用的水平对齐(仅当 type 为 \"figure\" 时有效)。", Optional: true}, {Name: "image_width", Type: "float64", Doc: "定义图片宽度(仅当 type 为 \"figure\" 时有效)。", Optional: true}, {Name: "image_fill_width", Type: "bool", Doc: "指示 image_width 是否按图块宽度的比例解释(仅当 type 为 \"figure\" 时有效)。", Optional: true}, {Name: "image_height", Type: "float64", Doc: "定义图片高度(仅当 type 为 \"figure\" 时有效)。", Optional: true}, {Name: "fit", Type: "string", Doc: "指定图片在给定尺寸内的适配方式:contain 保持比例,stretch 拉伸(仅当 type 为 \"figure\" 时有效)。", Optional: true}, }}, {Name: "DetailPagination", Path: "pages[].paginate", Doc: "描述固定区域明细表;列宽之和必须等于 area.width,所有尺寸均为毫米。", Fields: []FieldDoc{ {Name: "path", Type: "string", Doc: "是当前记录中的明细数组路径;$. 前缀从根数据读取。", Optional: false}, {Name: "area", Type: "Box", Doc: "是含表头的明细区域,放不下的完整行转入下一页。", Optional: false}, {Name: "columns", Type: "[]DetailColumn", Doc: "定义表头、列宽和逐行文字绑定。", Optional: false}, {Name: "font", Type: "string", Doc: "指定完整字体资源,省略时嵌入 Go Regular。", Optional: true}, {Name: "size", Type: "float64", Doc: "是明细字号,默认 3.5mm。", Optional: true}, {Name: "header_height", Type: "float64", Doc: "是重复表头高度,0 表示按文字实际高度计算且至少 8mm。", Optional: true}, {Name: "row_height", Type: "float64", Doc: "是最小行高,默认 8mm;换行会增高整行,不拆分单行。", Optional: true}, {Name: "padding", Type: "*float64", Doc: "是单元格四边内边距,默认 1.5mm,可显式设为 0。", Optional: true}, {Name: "line_width", Type: "float64", Doc: "是网格线宽,默认 0.2mm。", Optional: true}, {Name: "border_color", Type: "*Color", Doc: "是网格颜色,默认中性灰。", Optional: true}, {Name: "header_fill", Type: "*Color", Doc: "是表头背景色,省略时使用浅灰。", Optional: true}, }}, {Name: "PageVariants", Path: "pages[].variants", Doc: "定义明细分页的附加内容和明细区域。", Fields: []FieldDoc{ {Name: "first", Type: "*PageVariant", Doc: "用于多页单据的首页。", Optional: true}, {Name: "continuation", Type: "*PageVariant", Doc: "用于中间页,也作为未配置 last 时的末页版式。", Optional: true}, {Name: "last", Type: "*PageVariant", Doc: "用于多页单据的末页。", Optional: true}, {Name: "single", Type: "*PageVariant", Doc: "用于单页单据;省略时按 last、first 的顺序回退。", Optional: true}, }}, {Name: "TemplateRef", Path: "pages[].templates[]", Doc: "描述页面对模板页的引用。", Fields: []FieldDoc{ {Name: "id", Type: "uint64", Doc: "指定所引用的模板页。", Optional: true}, {Name: "z_order", Type: "string", Doc: "指定模板引用的层叠顺序。", Optional: true}, }}, {Name: "PageResource", Path: "pages[].resources[]", Doc: "描述页面级资源文件或嵌入式图像。", Fields: []FieldDoc{ {Name: "file", Type: "string", Doc: "指定页面资源文件路径。", Optional: true}, {Name: "data_base64", Type: "string", Doc: "提供 Base64 编码的页面资源数据。", Optional: true}, {Name: "images", Type: "[]PageImage", Doc: "定义资源中的图像。", Optional: true}, {Name: "files", Type: "[]ResourceFile", Doc: "定义页面资源包中的文件。", Optional: true}, }}, {Name: "FlowOfficial", Path: "flow.official", Doc: "定义常规公文专用要素;启用时使用 A4 和 156×225mm 版心。", Fields: []FieldDoc{ {Name: "fonts", Type: "FlowOfficialFonts", Doc: "指定五类专用字体资源;调用方负责提供对应字形。", Optional: false}, {Name: "letterhead", Type: "*FlowOfficialLetterhead", Doc: "定义仅在首页出现的版头。", Optional: true}, {Name: "signature", Type: "*FlowOfficialSignature", Doc: "定义不加盖印章的单一机关落款。", Optional: true}, {Name: "colophon", Type: "*FlowOfficialColophon", Doc: "定义锚定末页版心下边缘的版记。", Optional: true}, }}, {Name: "FlowColumns", Path: "flow.columns", Doc: "定义从左到右顺序流动的等宽栏,可选择平衡节末页。", Fields: []FieldDoc{ {Name: "count", Type: "int", Doc: "是栏数,0 或 1 表示单栏,支持 2 到 8 栏。", Optional: true}, {Name: "gap", Type: "float64", Doc: "是毫米单位的栏间距,须为有限非负数,零表示无栏间距。", Optional: true}, {Name: "balance", Type: "bool", Doc: "在多栏节末页按合法断点重排栏高;含显式换栏的末页保持原布局。", Optional: true}, }}, {Name: "FlowNamedStyle", Path: "flow.styles[]", Doc: "是可复用的文字样式,名称在文档内唯一且不含空白。", Fields: []FieldDoc{ {Name: "name", Type: "string", Doc: "是引用此样式的名称。", Optional: false}, {Name: "style", Type: "FlowStyle", Doc: "定义样式字段,可通过 based_on 继承其他命名样式,最多 64 层。", Optional: false}, }}, {Name: "FlowFootnote", Path: "flow.footnotes[]", Doc: "定义与引用行或表格行组同栏的脚注,同栏重复引用只排一次。", Fields: []FieldDoc{ {Name: "id", Type: "string", Doc: "是脚注定义内唯一的名称,不含空白或控制字符。", Optional: false}, {Name: "text", Type: "string", Doc: "是注释纯文本,与 runs 互斥。", Optional: true}, {Name: "runs", Type: "[]FlowRun", Doc: "是带样式和链接的注释片段,不能嵌套脚注。", Optional: true}, {Name: "style", Type: "*FlowStyle", Doc: "覆盖全局脚注样式,支持 based_on 和显式零间距。", Optional: true}, }}, {Name: "FlowStyle", Path: "flow.footnote_style", Doc: "覆盖文字样式,省略或 null 字段继承;显式零间距和零缩进会清除上层值。\n字号为磅,行高为倍率,其余长度为毫米;字号、行高不能显式设为零。", Fields: []FieldDoc{ {Name: "based_on", Type: "string", Doc: "是在当前字段之前应用的命名样式。", Optional: true}, {Name: "font", Type: "string", Doc: "是字体资源名。", Optional: true}, {Name: "size", Type: "*float64", Doc: "是字号,单位磅。", Optional: true}, {Name: "line_height", Type: "*float64", Doc: "是行高倍率。", Optional: true}, {Name: "space_before", Type: "*float64", Doc: "是段前间距。", Optional: true}, {Name: "space_after", Type: "*float64", Doc: "是段后间距。", Optional: true}, {Name: "first_line_indent", Type: "*float64", Doc: "是首行缩进。", Optional: true}, {Name: "align", Type: "string", Doc: "是 left、center、right 或 justify;justify 仅伸展自动换行的行,段末和显式换行保持自然宽度。", Optional: true}, {Name: "color", Type: "*Color", Doc: "是文字颜色。", Optional: true}, }}, {Name: "FlowFontFamily", Path: "flow.font_families[]", Doc: "关联同一字体族的四种实际字体面。", Fields: []FieldDoc{ {Name: "regular", Type: "string", Doc: "是必填的常规字体资源名。", Optional: false}, {Name: "bold", Type: "string", Doc: "是粗体字体资源名,省略时保留原字体。", Optional: true}, {Name: "italic", Type: "string", Doc: "是斜体字体资源名,省略时保留原字体。", Optional: true}, {Name: "bold_italic", Type: "string", Doc: "是粗斜体字体资源名,缺少时按粗体、斜体、原字体顺序选择。", Optional: true}, }}, {Name: "FlowMargins", Path: "flow.margins", Doc: "是毫米单位的页边距。", Fields: []FieldDoc{ {Name: "top", Type: "float64", Doc: "是上页边距。", Optional: true}, {Name: "right", Type: "float64", Doc: "是右页边距。", Optional: true}, {Name: "bottom", Type: "float64", Doc: "是下页边距。", Optional: true}, {Name: "left", Type: "float64", Doc: "是左页边距。", Optional: true}, }}, {Name: "FlowBlock", Path: "flow.blocks[]", Doc: "是无需坐标的内容块。", Fields: []FieldDoc{ {Name: "id", Type: "string", Doc: "是文档内唯一内容标识,不含空白,不能以 __flow_ 开头;换页、换栏和分节块不能设置。", Optional: true}, {Name: "type", Type: "string", Doc: "是 paragraph、heading、recipient、list_item、image、table、fixed、toc、section、page_break 或 column_break,缺省 paragraph;recipient 为公文主送机关。", Optional: true}, {Name: "text", Type: "string", Doc: "是纯文本内容,与 runs 互斥。", Optional: true}, {Name: "runs", Type: "[]FlowRun", Doc: "是带局部样式的文字片段,与 text 互斥。", Optional: true}, {Name: "level", Type: "int", Doc: "是标题级别,heading 必须为 1 到 6。", Optional: true}, {Name: "marker", Type: "string", Doc: "是列表标记,list_item 缺省使用圆点。", Optional: true}, {Name: "style", Type: "*FlowStyle", Doc: "覆盖主题样式。", Optional: true}, {Name: "keep_with_next", Type: "bool", Doc: "尽量与后续内容的开头保持同页;连续设置会组成跟随链,标题和公文主送机关默认启用。", Optional: true}, {Name: "keep_together", Type: "bool", Doc: "能放入完整一页时尽量整块同页。", Optional: true}, {Name: "page_break_before", Type: "bool", Doc: "在此块之前换页。", Optional: true}, {Name: "page_break_after", Type: "bool", Doc: "在此块之后换页。", Optional: true}, {Name: "orphans", Type: "int", Doc: "是段落跨页时前页至少保留的行数,缺省 2。", Optional: true}, {Name: "widows", Type: "int", Doc: "是段落跨页时后页至少保留的行数,缺省 2。", Optional: true}, {Name: "image", Type: "*FlowImage", Doc: "是图片与图注,type 为 image 时使用。", Optional: true}, {Name: "table", Type: "*FlowTable", Doc: "是简单网格表格,type 为 table 时使用。", Optional: true}, {Name: "fixed", Type: "*FlowFixed", Doc: "是整块分页的固定图元区域。", Optional: true}, {Name: "toc", Type: "*FlowTOC", Doc: "配置 type 为 toc 的自动目录,支持多页条目和最终物理页码。", Optional: true}, {Name: "section", Type: "*FlowSection", Doc: "配置 type 为 section 的分节块,后续内容从新页开始。", Optional: true}, }}, {Name: "ActionRegion", Path: "document.actions[].region", Doc: "描述动作的触发区域。", Fields: []FieldDoc{ {Name: "areas", Type: "[]ActionArea", Doc: "定义动作区域中的路径。", Optional: true}, }}, {Name: "URIAction", Path: "document.actions[].uri", Doc: "描述打开或跳转到 URI 的动作。", Fields: []FieldDoc{ {Name: "uri", Type: "string", Doc: "指定目标 URI。", Optional: true}, {Name: "base", Type: "string", Doc: "指定 URI 基础地址。", Optional: true}, {Name: "target", Type: "string", Doc: "指定 URI 打开目标。", Optional: true}, }}, {Name: "GotoAction", Path: "document.actions[].goto", Doc: "描述跳转到页面、书签或页面位置的动作。", Fields: []FieldDoc{ {Name: "page", Type: "int", Doc: "指定跳转目标页码。", Optional: true}, {Name: "type", Type: "string", Doc: "指定跳转目标类型。", Optional: true}, {Name: "bookmark", Type: "string", Doc: "指定跳转目标书签名称。", Optional: true}, {Name: "left", Type: "*float64", Doc: "指定目标视图左边界。", Optional: true}, {Name: "top", Type: "*float64", Doc: "指定目标视图上边界。", Optional: true}, {Name: "right", Type: "*float64", Doc: "指定目标视图右边界。", Optional: true}, {Name: "bottom", Type: "*float64", Doc: "指定目标视图下边界。", Optional: true}, {Name: "zoom", Type: "*float64", Doc: "指定目标视图缩放比例。", Optional: true}, }}, {Name: "GotoAAction", Path: "document.actions[].goto_a", Doc: "描述跳转到附件的动作。", Fields: []FieldDoc{ {Name: "attach_id", Type: "string", Doc: "指定跳转目标附件标识。", Optional: true}, {Name: "new_window", Type: "*bool", Doc: "指示是否在新窗口打开附件。", Optional: true}, }}, {Name: "SoundAction", Path: "document.actions[].sound", Doc: "描述播放声音资源的动作。", Fields: []FieldDoc{ {Name: "resource_id", Type: "uint64", Doc: "指定声音资源编号。", Optional: true}, {Name: "volume", Type: "*int", Doc: "指定播放音量。", Optional: true}, {Name: "repeat", Type: "*bool", Doc: "指示是否循环播放。", Optional: true}, {Name: "synchronous", Type: "*bool", Doc: "指示是否同步播放。", Optional: true}, }}, {Name: "MovieAction", Path: "document.actions[].movie", Doc: "描述播放媒体资源的动作。", Fields: []FieldDoc{ {Name: "resource_id", Type: "uint64", Doc: "指定媒体资源编号。", Optional: true}, {Name: "operator", Type: "string", Doc: "指定媒体操作类型。", Optional: true}, }}, {Name: "ExtensionProperty", Path: "document.extensions[].properties[]", Doc: "描述扩展信息的属性。", Fields: []FieldDoc{ {Name: "name", Type: "string", Doc: "指定属性名称。", Optional: true}, {Name: "type", Type: "string", Doc: "指定属性类型。", Optional: true}, {Name: "value", Type: "string", Doc: "指定属性值。", Optional: true}, }}, {Name: "VersionFile", Path: "document.versions[].files[]", Doc: "描述文档版本中的文件。", Fields: []FieldDoc{ {Name: "id", Type: "string", Doc: "标识版本文件。", Optional: true}, {Name: "path", Type: "string", Doc: "指定文件在版本中的路径。", Optional: true}, }}, {Name: "Annotation", Path: "document.annotations[].items[]", Doc: "描述文档批注。", Fields: []FieldDoc{ {Name: "id", Type: "uint64", Doc: "标识批注。", Optional: true}, {Name: "type", Type: "string", Doc: "指定批注类型。", Optional: true}, {Name: "creator", Type: "string", Doc: "指定批注创建者。", Optional: true}, {Name: "last_mod_date", Type: "string", Doc: "记录批注最后修改时间。", Optional: true}, {Name: "visible", Type: "*bool", Doc: "指示批注是否可见。", Optional: true}, {Name: "subtype", Type: "string", Doc: "指定批注子类型。", Optional: true}, {Name: "print", Type: "*bool", Doc: "指示批注是否随文档打印。", Optional: true}, {Name: "no_zoom", Type: "bool", Doc: "指示批注是否不随页面缩放。", Optional: true}, {Name: "no_rotate", Type: "bool", Doc: "指示批注是否不随页面旋转。", Optional: true}, {Name: "read_only", Type: "*bool", Doc: "指示批注是否只读。", Optional: true}, {Name: "remark", Type: "string", Doc: "记录批注说明。", Optional: true}, {Name: "parameters", Type: "[]AnnotationParameter", Doc: "定义批注自定义参数。", Optional: true}, {Name: "boundary", Type: "*Box", Doc: "指定批注边界。", Optional: true}, {Name: "items", Type: "[]Item", Doc: "定义批注包含的图元。", Optional: true}, }}, {Name: "Box", Path: "document.area.physical_box", Doc: "描述矩形区域。", Fields: []FieldDoc{ {Name: "x", Type: "float64", Doc: "指定矩形左上角横坐标。", Optional: true}, {Name: "y", Type: "float64", Doc: "指定矩形左上角纵坐标。", Optional: true}, {Name: "width", Type: "float64", Doc: "指定矩形宽度。", Optional: true}, {Name: "height", Type: "float64", Doc: "指定矩形高度。", Optional: true}, }}, {Name: "PrintSettings", Path: "document.permissions.print", Doc: "描述文档打印设置。", Fields: []FieldDoc{ {Name: "printable", Type: "bool", Doc: "指示是否允许打印。", Optional: true}, {Name: "copies", Type: "*int", Doc: "指定允许或默认的打印份数。", Optional: true}, }}, {Name: "ValidPeriod", Path: "document.permissions.valid_period", Doc: "描述权限的有效时间范围。", Fields: []FieldDoc{ {Name: "start", Type: "string", Doc: "指定权限生效时间。", Optional: true}, {Name: "end", Type: "string", Doc: "指定权限失效时间。", Optional: true}, }}, {Name: "SignatureReference", Path: "document.signatures[].references[]", Doc: "描述数字签名引用的文件及校验值。", Fields: []FieldDoc{ {Name: "file_ref", Type: "string", Doc: "指定签名引用的文件路径。", Optional: true}, {Name: "check_value", Type: "string", Doc: "提供 Base64 编码的文件校验值。", Optional: true}, }}, {Name: "SignatureStamp", Path: "document.signatures[].stamp_annots[]", Doc: "描述数字签名在页面上的盖章区域。", Fields: []FieldDoc{ {Name: "id", Type: "string", Doc: "标识签名盖章区域。", Optional: true}, {Name: "page", Type: "int", Doc: "指定盖章所在页码。", Optional: true}, {Name: "boundary", Type: "Box", Doc: "指定盖章区域边界。", Optional: true}, {Name: "clip", Type: "*Box", Doc: "指定盖章区域裁剪框。", Optional: true}, }}, {Name: "Color", Path: "resources.draw_params[].fill_color", Doc: "描述颜色及其渐变或图案填充信息。", Fields: []FieldDoc{ {Name: "r", Type: "uint8", Doc: "指定红色分量。", Optional: true}, {Name: "g", Type: "uint8", Doc: "指定绿色分量。", Optional: true}, {Name: "b", Type: "uint8", Doc: "指定蓝色分量。", Optional: true}, {Name: "components", Type: "[]int", Doc: "指定颜色空间分量值。", Optional: true}, {Name: "color_space", Type: "uint64", Doc: "指定颜色空间资源编号。", Optional: true}, {Name: "index", Type: "*int", Doc: "指定调色板颜色索引。", Optional: true}, {Name: "alpha", Type: "*uint8", Doc: "指定颜色透明度。", Optional: true}, {Name: "axial", Type: "*AxialShading", Doc: "定义轴向渐变。", Optional: true}, {Name: "radial", Type: "*RadialShading", Doc: "定义径向渐变。", Optional: true}, {Name: "gouraud", Type: "*Gouraud", Doc: "定义三角网格渐变。", Optional: true}, {Name: "la_gouraud", Type: "*LaGouraud", Doc: "定义四边形网格渐变。", Optional: true}, {Name: "pattern", Type: "*Pattern", Doc: "定义图案填充。", Optional: true}, }}, {Name: "ResourceFile", Path: "resources.public[].files[]", Doc: "描述资源包中的文件。", Fields: []FieldDoc{ {Name: "path", Type: "string", Doc: "指定文件在资源包中的路径。", Optional: true}, {Name: "file", Type: "string", Doc: "指定源文件路径。", Optional: true}, {Name: "data_base64", Type: "string", Doc: "提供 Base64 编码的文件数据。", Optional: true}, }}, {Name: "Binding", Path: "templates[].items[].bind", Doc: "定义模板字段;长度和字号均为毫米,数据路径使用点分隔对象键。", Fields: []FieldDoc{ {Name: "path", Type: "string", Doc: "从当前记录读取字段;$. 前缀读取根数据;内置序号 @index/@number、页码 @page/@pages、单据页码 @detail_page/@detail_pages。", Optional: false}, {Name: "aggregate", Type: "string", Doc: "是 page_sum 或 record_sum,对当前页或整张单据的明细字段精确求和,仅用于 paginate 页面。", Optional: true}, {Name: "decimal_places", Type: "*int", Doc: "是求和结果的小数位数(0—18),默认 2,精确求和后四舍五入。", Optional: true}, {Name: "required", Type: "*bool", Doc: "默认 true;false 时缺失或 null 字段移除该图元,空字符串也移除图元。", Optional: true}, {Name: "default", Type: "*string", Doc: "是缺失或 null 字段的默认字符串,优先于 required。", Optional: true}, {Name: "overflow", Type: "string", Doc: "是 error(默认)、wrap、shrink 或 ellipsis,仅用于文字。", Optional: true}, {Name: "align", Type: "string", Doc: "是 left(默认)、center 或 right,仅用于文字。", Optional: true}, {Name: "min_size", Type: "float64", Doc: "是 shrink 的最小字号,单位毫米;shrink 时必须显式指定。", Optional: true}, {Name: "max_lines", Type: "int", Doc: "是 wrap 的最大行数,0 表示仅按区域高度限制。", Optional: true}, {Name: "line_height", Type: "float64", Doc: "是 wrap 的行高倍率,默认 1.2。", Optional: true}, }}, {Name: "TextCode", Path: "templates[].items[].text_codes[]", Doc: "描述文本内容及其定位信息。", Fields: []FieldDoc{ {Name: "value", Type: "string", Doc: "指定文本内容。", Optional: true}, {Name: "x", Type: "*float64", Doc: "指定文本代码横坐标。", Optional: true}, {Name: "y", Type: "*float64", Doc: "指定文本代码纵坐标。", Optional: true}, {Name: "delta_x", Type: "[]float64", Doc: "指定连续字符的横向偏移量。", Optional: true}, {Name: "delta_y", Type: "[]float64", Doc: "指定连续字符的纵向偏移量。", Optional: true}, }}, {Name: "CGTransform", Path: "templates[].items[].cg_transforms[]", Doc: "描述文本代码与字形之间的映射关系。", Fields: []FieldDoc{ {Name: "code_position", Type: "int", Doc: "指定文本代码起始位置。", Optional: true}, {Name: "code_count", Type: "int", Doc: "指定映射的文本代码数量。", Optional: true}, {Name: "glyph_count", Type: "int", Doc: "指定对应的字形数量。", Optional: true}, {Name: "glyphs", Type: "[]int", Doc: "指定对应字形编号列表。", Optional: true}, }}, {Name: "Clip", Path: "templates[].items[].clips[]", Doc: "描述图元的裁剪区域集合。", Fields: []FieldDoc{ {Name: "areas", Type: "[]ClipArea", Doc: "定义裁剪区域。", Optional: true}, }}, {Name: "ImageBorder", Path: "templates[].items[].border", Doc: "描述图像边框的绘制样式。", Fields: []FieldDoc{ {Name: "line_width", Type: "float64", Doc: "指定图像边框线宽。", Optional: true}, {Name: "horizontal_radius", Type: "float64", Doc: "指定边框水平圆角半径。", Optional: true}, {Name: "vertical_radius", Type: "float64", Doc: "指定边框垂直圆角半径。", Optional: true}, {Name: "dash_offset", Type: "float64", Doc: "指定边框虚线起始偏移量。", Optional: true}, {Name: "dash_pattern", Type: "[]float64", Doc: "指定边框虚线长度模式。", Optional: true}, {Name: "color", Type: "*Color", Doc: "指定边框颜色。", Optional: true}, }}, {Name: "TableRow", Path: "templates[].items[].rows[]", Doc: "定义表格行。", Fields: []FieldDoc{ {Name: "cells", Type: "[]TableCell", Doc: "定义该行包含的单元格。", Optional: true}, }}, {Name: "TableStyle", Path: "templates[].items[].style", Doc: "定义表格样式。", Fields: []FieldDoc{ {Name: "horizontal_lines", Type: "bool", Doc: "指示是否绘制横线。", Optional: true}, {Name: "vertical_lines", Type: "bool", Doc: "指示是否绘制竖线。", Optional: true}, {Name: "line_width", Type: "float64", Doc: "定义内部线宽。", Optional: true}, {Name: "stroke_color", Type: "*Color", Doc: "定义边框颜色。", Optional: true}, {Name: "outer_line_width", Type: "float64", Doc: "定义外框线宽。", Optional: true}, {Name: "header_line_width", Type: "float64", Doc: "定义表头分隔线宽。", Optional: true}, {Name: "header_fill_color", Type: "*Color", Doc: "定义表头背景色。", Optional: true}, {Name: "header_font", Type: "string", Doc: "定义表头字体。", Optional: true}, {Name: "header_size", Type: "float64", Doc: "定义表头字号。", Optional: true}, {Name: "header_weight", Type: "int", Doc: "定义表头字重。", Optional: true}, {Name: "strike_color", Type: "*Color", Doc: "定义 Markdown 删除线的颜色;不设时与边框同色。", Optional: true}, {Name: "link_color", Type: "*Color", Doc: "定义 Markdown 行内链接的文字颜色;不设时用默认链接蓝。", Optional: true}, {Name: "rule_color", Type: "*Color", Doc: "定义 Markdown 分隔线的颜色;不设时与边框同色。", Optional: true}, {Name: "code_font", Type: "string", Doc: "定义 Markdown 行内代码使用的字体。", Optional: true}, }}, {Name: "CaptionStyle", Path: "templates[].items[].caption_style", Doc: "定义表题样式。", Fields: []FieldDoc{ {Name: "font", Type: "string", Doc: "定义字体。", Optional: true}, {Name: "size", Type: "float64", Doc: "定义字号。", Optional: true}, {Name: "weight", Type: "int", Doc: "定义字重。", Optional: true}, {Name: "italic", Type: "bool", Doc: "指示是否斜体。", Optional: true}, {Name: "align", Type: "string", Doc: "定义对齐方式。", Optional: true}, {Name: "color", Type: "*Color", Doc: "定义文字颜色。", Optional: true}, {Name: "gap", Type: "float64", Doc: "定义说明文字与所标注对象之间的间距,单位毫米。", Optional: true}, }}, {Name: "DetailColumn", Path: "pages[].paginate.columns[]", Doc: "定义明细列;bind.path 相对于当前明细行,默认 overflow 为 wrap。", Fields: []FieldDoc{ {Name: "title", Type: "string", Doc: "是每页重复的表头文字。", Optional: true}, {Name: "width", Type: "float64", Doc: "是列宽,必须大于两倍 padding。", Optional: false}, {Name: "bind", Type: "Binding", Doc: "读取明细字段,可使用 @index/@number 表示整张单据内的行序号。", Optional: false}, }}, {Name: "PageVariant", Path: "pages[].variants.first", Doc: "追加到公共页面;不替换公共图元或模板引用。", Fields: []FieldDoc{ {Name: "templates", Type: "[]TemplateRef", Doc: "是该版式附加的 OFD 模板页引用。", Optional: true}, {Name: "items", Type: "[]Item", Doc: "是该版式附加的固定图元,与 layers 互斥。", Optional: true}, {Name: "layers", Type: "[]Layer", Doc: "是该版式附加的图层,与 items 互斥。", Optional: true}, {Name: "detail_area", Type: "*Box", Doc: "覆盖明细区域的位置和高度;宽度必须等于公共明细区域宽度。", Optional: true}, }}, {Name: "PageImage", Path: "pages[].resources[].images[]", Doc: "描述页面资源中的图像。", Fields: []FieldDoc{ {Name: "id", Type: "uint64", Doc: "标识页面图像资源。", Optional: true}, {Name: "format", Type: "string", Doc: "指定图像格式。", Optional: true}, {Name: "name", Type: "string", Doc: "指定图像名称。", Optional: true}, {Name: "file", Type: "string", Doc: "指定图像文件路径。", Optional: true}, {Name: "data_base64", Type: "string", Doc: "提供 Base64 编码的图像数据。", Optional: true}, }}, {Name: "FlowOfficialFonts", Path: "flow.official.fonts", Doc: "引用 resources.fonts 中已注册的字体,不按资源名猜测实际字形。", Fields: []FieldDoc{ {Name: "body", Type: "string", Doc: "是三号正文及版记使用的仿宋字体资源。", Optional: false}, {Name: "title", Type: "string", Doc: "是标题和发文机关标志使用的小标宋字体资源。", Optional: false}, {Name: "hei", Type: "string", Doc: "是第一层结构序数、密级及紧急程度使用的黑体字体资源。", Optional: false}, {Name: "kai", Type: "string", Doc: "是第二层结构序数和签发人姓名使用的楷体字体资源。", Optional: false}, {Name: "song", Type: "string", Doc: "是四号半角页码使用的宋体字体资源。", Optional: false}, }}, {Name: "FlowOfficialLetterhead", Path: "flow.official.letterhead", Doc: "是首页常规版头;不含联合行文、信函或命令专用格式。", Fields: []FieldDoc{ {Name: "org", Type: "string", Doc: "是发文机关标志,不自动追加“文件”。", Optional: false}, {Name: "doc_no", Type: "string", Doc: "是完整发文字号,由调用方提供规范文字。", Optional: true}, {Name: "signatory", Type: "string", Doc: "是单个签发人姓名,非空时采用上行文并排布局。", Optional: true}, {Name: "serial_no", Type: "string", Doc: "是份号。", Optional: true}, {Name: "security", Type: "string", Doc: "是密级和保密期限。", Optional: true}, {Name: "urgency", Type: "string", Doc: "是紧急程度。", Optional: true}, {Name: "org_size", Type: "float64", Doc: "是机关标志字号,单位磅,缺省 32;过宽时报错。", Optional: true}, }}, {Name: "FlowOfficialSignature", Path: "flow.official.signature", Doc: "是不加盖印章的单一机关落款。", Fields: []FieldDoc{ {Name: "org", Type: "string", Doc: "是发文机关署名。", Optional: true}, {Name: "date", Type: "string", Doc: "是完整成文日期,由调用方使用规范日期文字。", Optional: true}, }}, {Name: "FlowOfficialColophon", Path: "flow.official.colophon", Doc: "是末页版记,行宽不足时报错或按悬挂缩进换行。", Fields: []FieldDoc{ {Name: "cc", Type: "string", Doc: "是抄送机关,不含自动添加的“抄送:”。", Optional: true}, {Name: "issued_by", Type: "string", Doc: "是印发机关。", Optional: true}, {Name: "issued_date", Type: "string", Doc: "是印发日期,不含自动添加的“印发”。", Optional: true}, }}, {Name: "FlowRun", Path: "flow.footnotes[].runs[]", Doc: "是段落内的同样式文字片段。", Fields: []FieldDoc{ {Name: "text", Type: "string", Doc: "是文字内容。", Optional: false}, {Name: "font", Type: "string", Doc: "显式指定字体资源名,空值继承块级字体。", Optional: true}, {Name: "bold", Type: "bool", Doc: "选择 flow.bold_font 配置的字体面。", Optional: true}, {Name: "italic", Type: "bool", Doc: "选择 flow.italic_font 配置的字体面。", Optional: true}, {Name: "strike", Type: "bool", Doc: "绘制删除线。", Optional: true}, {Name: "href", Type: "string", Doc: "定义此片段的点击链接。", Optional: true}, {Name: "target", Type: "string", Doc: "指向内容块的 id,与 href 互斥。", Optional: true}, {Name: "page_ref", Type: "string", Doc: "按 reference_page_numbers 显示目标最终页码并提供跳转,与 text、href、target 及其他引用字段互斥。", Optional: true}, {Name: "caption_ref", Type: "string", Doc: "显示带编号图表的标签并跳转,与 text、href、target 及其他引用字段互斥。", Optional: true}, {Name: "title_ref", Type: "string", Doc: "显示章节标题或完整图表题注并跳转,与 text、href、target、page_ref、caption_ref、footnote 互斥。", Optional: true}, {Name: "footnote", Type: "string", Doc: "显示脚注编号上标(所在文字 75% 字号、上移 0.3em),与 text、href、target 及其他引用字段互斥。", Optional: true}, }}, {Name: "FlowImage", Path: "flow.blocks[].image", Doc: "定义图片资源及排版尺寸。", Fields: []FieldDoc{ {Name: "file", Type: "string", Doc: "是资源根目录内的图片路径,与 data_base64 互斥。", Optional: true}, {Name: "data_base64", Type: "string", Doc: "是 Base64 图片数据,与 file 互斥。", Optional: true}, {Name: "width", Type: "float64", Doc: "是图片宽度,单位毫米,缺省按原图比例推算。", Optional: true}, {Name: "height", Type: "float64", Doc: "是图片高度,单位毫米,缺省按原图比例推算。", Optional: true}, {Name: "caption", Type: "string", Doc: "是图片下方的说明文字。", Optional: true}, {Name: "numbered", Type: "bool", Doc: "为图注添加连续编号,图片与表格分别计数。", Optional: true}, {Name: "caption_prefix", Type: "string", Doc: "是编号前缀,缺省 Figure;需要 numbered。", Optional: true}, }}, {Name: "FlowTable", Path: "flow.blocks[].table", Doc: "定义表格,按完整行组分页,续页重复表头。", Fields: []FieldDoc{ {Name: "split_rows", Type: "bool", Doc: "按完整文字行跨页或跨栏拆分普通及 ColSpan 单元格;正文 RowSpan 不支持。", Optional: true}, {Name: "header", Type: "[]string", Doc: "是可选表头。", Optional: true}, {Name: "rows", Type: "[][]string", Doc: "是等列数的数据行。", Optional: true}, {Name: "column_widths", Type: "[]float64", Doc: "是毫米单位的列宽,省略时均分版心。", Optional: true}, {Name: "grid", Type: "[][]FlowTableCell", Doc: "是支持合并、样式与链接的单元格网格,与 header/rows 互斥;被合并占据的位置无需占位。", Optional: true}, {Name: "header_rows", Type: "int", Doc: "是 grid 开头在续页重复的行数,合并不能跨越表头与正文边界。", Optional: true}, {Name: "columns", Type: "[]FlowTableColumn", Doc: "配置按内容测量的自动列宽,与 column_widths 互斥;每项对应一列。", Optional: true}, {Name: "cell_style", Type: "*FlowCellStyle", Doc: "设置全表单元格默认外观,单元格 appearance 可以覆盖。", Optional: true}, {Name: "stripe_fill", Type: "*Color", Doc: "设置正文从第二行开始的隔行底色,跨页保持行序。", Optional: true}, {Name: "caption", Type: "string", Doc: "是表格上方的题注。", Optional: true}, {Name: "numbered", Type: "bool", Doc: "为表题添加连续编号,图片与表格分别计数。", Optional: true}, {Name: "caption_prefix", Type: "string", Doc: "是编号前缀,缺省 Table;需要 numbered。", Optional: true}, {Name: "repeat_caption", Type: "bool", Doc: "在续页表头上方重复题注,题注与首个行组同页。", Optional: true}, {Name: "continuation_suffix", Type: "string", Doc: "是续表题后缀,缺省 (continued)。", Optional: true}, }}, {Name: "FlowFixed", Path: "flow.blocks[].fixed", Doc: "将原始图元作为固定区域插入流式文档,长度与图元字号均为毫米。", Fields: []FieldDoc{ {Name: "width", Type: "float64", Doc: "是预留宽度,省略时使用当前栏宽,单栏时为版心宽度;超宽时报错。", Optional: true}, {Name: "height", Type: "float64", Doc: "是必须给出的正数高度,不含图注。", Optional: false}, {Name: "align", Type: "string", Doc: "为 left(默认)、center 或 right。", Optional: true}, {Name: "items", Type: "[]Item", Doc: "是相对块左上角的图元,支持 text、path、image、composite、page-block。", Optional: false}, {Name: "caption", Type: "string", Doc: "是区域下方的图注。", Optional: true}, {Name: "numbered", Type: "bool", Doc: "与 image 共用连续图编号。", Optional: true}, {Name: "caption_prefix", Type: "string", Doc: "是编号前缀,缺省 Figure;需要 numbered。", Optional: true}, }}, {Name: "FlowTOC", Path: "flow.blocks[].toc", Doc: "配置标题、图或表目录,默认标题目录的最大标题级别为 3。", Fields: []FieldDoc{ {Name: "title", Type: "string", Doc: "是目录标题,显式空值表示省略标题。", Optional: true}, {Name: "max_level", Type: "int", Doc: "是标题目录的最大标题级别,0 表示 3,可取 1 到 6;图表目录必须省略或为 0。", Optional: true}, {Name: "source", Type: "string", Doc: "选择 headings(默认)、figures 或 tables;图表目录仅收集带编号内容,max_level 仅用于标题目录。", Optional: true}, }}, {Name: "FlowSection", Path: "flow.blocks[].section", Doc: "按需覆盖后续页面设置;省略字段继承前节,空字符串和 false 可显式清除。", Fields: []FieldDoc{ {Name: "page_size", Type: "*FlowSectionSize", Doc: "覆盖纸张尺寸,单位毫米,须同时给出正数 width 和 height。", Optional: true}, {Name: "margins", Type: "*FlowMargins", Doc: "覆盖四边页边距,单位毫米,零值表示零边距。", Optional: true}, {Name: "columns", Type: "*FlowColumns", Doc: "覆盖后续页面的分栏设置,省略时继承前节;count: 1 恢复单栏。", Optional: true}, {Name: "header", Type: "*string", Doc: "覆盖页眉,空字符串清除前节页眉。", Optional: true}, {Name: "footer", Type: "*string", Doc: "覆盖页脚,空字符串清除前节页脚。", Optional: true}, {Name: "page_numbers", Type: "*bool", Doc: "控制自动页码显示,false 可隐藏封面页码。", Optional: true}, {Name: "start_page_number", Type: "*int", Doc: "从正数开始重新编号,省略时接续前节。", Optional: true}, {Name: "page_number_style", Type: "string", Doc: "是 decimal、roman 或 ROMAN,省略继承前节;罗马编号支持 1 到 3999。", Optional: true}, {Name: "page_number_prefix", Type: "*string", Doc: "是编号前缀,如 A-,空字符串清除前缀。", Optional: true}, {Name: "first_page_header", Type: "*string", Doc: "只覆盖本节首页页眉,不继承到下一节。", Optional: true}, {Name: "first_page_footer", Type: "*string", Doc: "只覆盖本节首页页脚,不继承到下一节。", Optional: true}, {Name: "hide_first_page_number", Type: "bool", Doc: "隐藏本节首页自动追加的页码,首页仍占用编号。", Optional: true}, }}, {Name: "ActionArea", Path: "document.actions[].region.areas[]", Doc: "描述触发区域中的一条路径。", Fields: []FieldDoc{ {Name: "start", Type: "Point", Doc: "指定路径起点。", Optional: true}, {Name: "commands", Type: "[]RegionCommand", Doc: "定义路径绘制命令。", Optional: true}, }}, {Name: "AnnotationParameter", Path: "document.annotations[].items[].parameters[]", Doc: "描述批注的自定义参数。", Fields: []FieldDoc{ {Name: "name", Type: "string", Doc: "指定批注参数名称。", Optional: true}, {Name: "value", Type: "string", Doc: "指定批注参数值。", Optional: true}, }}, {Name: "AxialShading", Path: "resources.draw_params[].fill_color.axial", Doc: "描述轴向渐变。", Fields: []FieldDoc{ {Name: "map_type", Type: "string", Doc: "指定渐变映射类型。", Optional: true}, {Name: "map_unit", Type: "float64", Doc: "指定渐变映射单位。", Optional: true}, {Name: "extend", Type: "int", Doc: "指定渐变端点的延伸方式。", Optional: true}, {Name: "start_point", Type: "string", Doc: "指定渐变起点。", Optional: true}, {Name: "end_point", Type: "string", Doc: "指定渐变终点。", Optional: true}, {Name: "segments", Type: "[]ColorStop", Doc: "定义渐变颜色停止点。", Optional: true}, }}, {Name: "RadialShading", Path: "resources.draw_params[].fill_color.radial", Doc: "描述径向渐变。", Fields: []FieldDoc{ {Name: "map_type", Type: "string", Doc: "指定渐变映射类型。", Optional: true}, {Name: "map_unit", Type: "float64", Doc: "指定渐变映射单位。", Optional: true}, {Name: "eccentricity", Type: "float64", Doc: "指定径向渐变椭圆离心率。", Optional: true}, {Name: "angle", Type: "float64", Doc: "指定径向渐变旋转角度。", Optional: true}, {Name: "start_point", Type: "string", Doc: "指定渐变起点圆心。", Optional: true}, {Name: "start_radius", Type: "float64", Doc: "指定渐变起始半径。", Optional: true}, {Name: "end_point", Type: "string", Doc: "指定渐变终点圆心。", Optional: true}, {Name: "end_radius", Type: "float64", Doc: "指定渐变结束半径。", Optional: true}, {Name: "extend", Type: "int", Doc: "指定渐变端点的延伸方式。", Optional: true}, {Name: "segments", Type: "[]ColorStop", Doc: "定义渐变颜色停止点。", Optional: true}, }}, {Name: "Gouraud", Path: "resources.draw_params[].fill_color.gouraud", Doc: "描述 Gouraud 三角网格渐变。", Fields: []FieldDoc{ {Name: "extend", Type: "int", Doc: "指定渐变边界的延伸方式。", Optional: true}, {Name: "points", Type: "[]GouraudPoint", Doc: "定义三角网格顶点。", Optional: true}, {Name: "back_color", Type: "*Color", Doc: "指定网格背景颜色。", Optional: true}, }}, {Name: "LaGouraud", Path: "resources.draw_params[].fill_color.la_gouraud", Doc: "描述 LaGouraud 四边形网格渐变。", Fields: []FieldDoc{ {Name: "vertices_per_row", Type: "int", Doc: "指定每行顶点数。", Optional: true}, {Name: "extend", Type: "int", Doc: "指定渐变边界的延伸方式。", Optional: true}, {Name: "points", Type: "[]LaGouraudPoint", Doc: "定义四边形网格顶点。", Optional: true}, {Name: "back_color", Type: "*Color", Doc: "指定网格背景颜色。", Optional: true}, }}, {Name: "Pattern", Path: "resources.draw_params[].fill_color.pattern", Doc: "描述图案填充及其内容。", Fields: []FieldDoc{ {Name: "width", Type: "float64", Doc: "指定图案单元宽度。", Optional: true}, {Name: "height", Type: "float64", Doc: "指定图案单元高度。", Optional: true}, {Name: "x_step", Type: "float64", Doc: "指定图案在横向的重复步长。", Optional: true}, {Name: "y_step", Type: "float64", Doc: "指定图案在纵向的重复步长。", Optional: true}, {Name: "reflect_method", Type: "string", Doc: "指定图案反射方式。", Optional: true}, {Name: "relative_to", Type: "string", Doc: "指定图案定位所依据的对象。", Optional: true}, {Name: "ctm", Type: "[]float64", Doc: "指定图案的坐标变换矩阵。", Optional: true}, {Name: "thumbnail", Type: "uint64", Doc: "指定图案缩略图资源编号。", Optional: true}, {Name: "items", Type: "[]Item", Doc: "定义图案中的图元。", Optional: true}, {Name: "layers", Type: "[]Layer", Doc: "定义图案中的图层。", Optional: true}, }}, {Name: "ClipArea", Path: "templates[].items[].clips[].areas[]", Doc: "描述裁剪区域中的一个路径或文本区域。", Fields: []FieldDoc{ {Name: "draw_param", Type: "string", Doc: "指定裁剪区域使用的绘制参数名称。", Optional: true}, {Name: "ctm", Type: "[]float64", Doc: "指定裁剪区域的坐标变换矩阵。", Optional: true}, {Name: "path", Type: "*ClipPath", Doc: "定义路径裁剪内容。", Optional: true}, {Name: "text", Type: "*ClipText", Doc: "定义文本裁剪内容。", Optional: true}, }}, {Name: "TableCell", Path: "templates[].items[].rows[].cells[]", Doc: "定义表格单元格。", Fields: []FieldDoc{ {Name: "value", Type: "string", Doc: "定义单元格文本内容。", Optional: true}, {Name: "font", Type: "string", Doc: "定义字体。", Optional: true}, {Name: "size", Type: "float64", Doc: "定义字号。", Optional: true}, {Name: "weight", Type: "int", Doc: "定义字重。", Optional: true}, {Name: "italic", Type: "bool", Doc: "指示是否斜体。", Optional: true}, {Name: "align", Type: "string", Doc: "定义对齐方式(left/center/right)。", Optional: true}, {Name: "col_span", Type: "int", Doc: "定义横向合并的列数。", Optional: true}, {Name: "row_span", Type: "int", Doc: "定义纵向合并的行数。", Optional: true}, {Name: "first_line_indent", Type: "float64", Doc: "定义首行缩进。", Optional: true}, {Name: "hanging_indent", Type: "float64", Doc: "定义续行缩进。", Optional: true}, {Name: "format", Type: "string", Doc: "定义文本格式(text/markdown)。", Optional: true}, {Name: "fill_color", Type: "*Color", Doc: "定义单元格背景色。", Optional: true}, {Name: "actions", Type: "[]Action", Doc: "定义单元格的点击动作,作用范围是整个单元格。", Optional: true}, }}, {Name: "FlowTableCell", Path: "flow.blocks[].table.grid[][]", Doc: "定义按空闲列依次放置的合并单元格。", Fields: []FieldDoc{ {Name: "text", Type: "string", Doc: "是纯文本,与 runs 互斥。", Optional: true}, {Name: "runs", Type: "[]FlowRun", Doc: "是带字体、字重和链接的文字片段,与 text 互斥。", Optional: true}, {Name: "col_span", Type: "int", Doc: "是跨列数量,零值表示 1。", Optional: true}, {Name: "row_span", Type: "int", Doc: "是跨行数量,零值表示 1。", Optional: true}, {Name: "style", Type: "*FlowStyle", Doc: "覆盖单元格文字样式,段间距位于文字上下方。", Optional: true}, {Name: "appearance", Type: "*FlowCellStyle", Doc: "覆盖表格默认单元格外观。", Optional: true}, }}, {Name: "FlowTableColumn", Path: "flow.blocks[].table.columns[]", Doc: "定义毫米单位的列宽约束和内容换行行为。", Fields: []FieldDoc{ {Name: "width", Type: "float64", Doc: "为固定列宽,零表示按内容分配。", Optional: true}, {Name: "min_width", Type: "float64", Doc: "是包含内边距的最小列宽。", Optional: true}, {Name: "max_width", Type: "float64", Doc: "是包含内边距的最大列宽,零表示不限制。", Optional: true}, {Name: "weight", Type: "float64", Doc: "是自动列剩余宽度的比例,零表示 1。", Optional: true}, {Name: "no_wrap", Type: "bool", Doc: "禁止自动换行,保留显式换行;不够宽时返回错误。", Optional: true}, {Name: "align", Type: "string", Doc: "是 left、center、right 或 justify,可由单元格 style 覆盖。", Optional: true}, }}, {Name: "FlowCellStyle", Path: "flow.blocks[].table.cell_style", Doc: "定义单元格外观,空字段继承默认设置。", Fields: []FieldDoc{ {Name: "fill", Type: "*Color", Doc: "是背景色,覆盖表头或隔行底色。", Optional: true}, {Name: "padding", Type: "*FlowMargins", Doc: "是四边内边距,显式空对象表示零内边距,缺省四边 1.5mm。", Optional: true}, {Name: "vertical_align", Type: "string", Doc: "为 top、middle 或 bottom,缺省 top。", Optional: true}, {Name: "borders", Type: "*FlowCellBorders", Doc: "按侧覆盖默认边框,相邻单元格的边框各自在内部绘制。", Optional: true}, }}, {Name: "FlowSectionSize", Path: "flow.blocks[].section.page_size", Doc: "是毫米单位的分节纸张尺寸。", Fields: []FieldDoc{ {Name: "width", Type: "float64", Doc: "是纸张宽度。", Optional: false}, {Name: "height", Type: "float64", Doc: "是纸张高度。", Optional: false}, }}, {Name: "Point", Path: "document.actions[].region.areas[].start", Doc: "描述二维坐标点。", Fields: []FieldDoc{ {Name: "x", Type: "float64", Doc: "指定横坐标。", Optional: true}, {Name: "y", Type: "float64", Doc: "指定纵坐标。", Optional: true}, }}, {Name: "RegionCommand", Path: "document.actions[].region.areas[].commands[]", Doc: "描述动作区域路径中的绘制命令。", Fields: []FieldDoc{ {Name: "type", Type: "string", Doc: "指定路径命令类型。", Optional: true}, {Name: "x", Type: "float64", Doc: "指定命令终点横坐标。", Optional: true}, {Name: "y", Type: "float64", Doc: "指定命令终点纵坐标。", Optional: true}, {Name: "control_x", Type: "float64", Doc: "指定二次贝塞尔曲线控制点横坐标。", Optional: true}, {Name: "control_y", Type: "float64", Doc: "指定二次贝塞尔曲线控制点纵坐标。", Optional: true}, {Name: "control_1_x", Type: "float64", Doc: "指定三次贝塞尔曲线第一个控制点横坐标。", Optional: true}, {Name: "control_1_y", Type: "float64", Doc: "指定三次贝塞尔曲线第一个控制点纵坐标。", Optional: true}, {Name: "control_2_x", Type: "float64", Doc: "指定三次贝塞尔曲线第二个控制点横坐标。", Optional: true}, {Name: "control_2_y", Type: "float64", Doc: "指定三次贝塞尔曲线第二个控制点纵坐标。", Optional: true}, {Name: "sweep_direction", Type: "bool", Doc: "指定椭圆弧的扫描方向。", Optional: true}, {Name: "large_arc", Type: "bool", Doc: "指示椭圆弧是否取大弧段。", Optional: true}, {Name: "rotation_angle", Type: "float64", Doc: "指定椭圆弧旋转角度。", Optional: true}, {Name: "ellipse_width", Type: "float64", Doc: "指定椭圆弧椭圆宽度。", Optional: true}, {Name: "ellipse_height", Type: "float64", Doc: "指定椭圆弧椭圆高度。", Optional: true}, }}, {Name: "ColorStop", Path: "resources.draw_params[].fill_color.axial.segments[]", Doc: "描述渐变中的颜色停止点。", Fields: []FieldDoc{ {Name: "position", Type: "*float64", Doc: "指定颜色在渐变中的位置。省略时不写出,由渲染按首尾补齐。", Optional: true}, {Name: "color", Type: "Color", Doc: "指定该位置的颜色。", Optional: false}, }}, {Name: "GouraudPoint", Path: "resources.draw_params[].fill_color.gouraud.points[]", Doc: "描述 Gouraud 渐变网格中的顶点。", Fields: []FieldDoc{ {Name: "x", Type: "float64", Doc: "指定顶点横坐标。", Optional: true}, {Name: "y", Type: "float64", Doc: "指定顶点纵坐标。", Optional: true}, {Name: "edge_flag", Type: "int", Doc: "指定顶点边标志。", Optional: true}, {Name: "color", Type: "Color", Doc: "指定顶点颜色。", Optional: true}, }}, {Name: "LaGouraudPoint", Path: "resources.draw_params[].fill_color.la_gouraud.points[]", Doc: "描述 LaGouraud 渐变网格中的顶点。", Fields: []FieldDoc{ {Name: "x", Type: "float64", Doc: "指定顶点横坐标。", Optional: true}, {Name: "y", Type: "float64", Doc: "指定顶点纵坐标。", Optional: true}, {Name: "color", Type: "Color", Doc: "指定顶点颜色。", Optional: true}, }}, {Name: "ClipPath", Path: "templates[].items[].clips[].areas[].path", Doc: "描述用于裁剪的路径。", Fields: []FieldDoc{ {Name: "boundary", Type: "Box", Doc: "指定裁剪路径边界。", Optional: true}, {Name: "name", Type: "string", Doc: "指定裁剪路径名称。", Optional: true}, {Name: "visible", Type: "*bool", Doc: "指示裁剪路径是否可见。", Optional: true}, {Name: "ctm", Type: "[]float64", Doc: "指定裁剪路径的坐标变换矩阵。", Optional: true}, {Name: "data", Type: "string", Doc: "指定裁剪路径数据。", Optional: true}, {Name: "stroke", Type: "bool", Doc: "指示是否绘制裁剪路径轮廓。", Optional: true}, {Name: "stroke_set", Type: "*bool", Doc: "指示是否显式设置描边属性。", Optional: true}, {Name: "fill", Type: "bool", Doc: "指示是否填充裁剪路径。", Optional: true}, {Name: "rule", Type: "string", Doc: "指定裁剪路径填充规则。", Optional: true}, {Name: "line_width", Type: "float64", Doc: "指定裁剪路径描边线宽。", Optional: true}, {Name: "cap", Type: "string", Doc: "指定裁剪路径端点样式。", Optional: true}, {Name: "join", Type: "string", Doc: "指定裁剪路径连接样式。", Optional: true}, {Name: "miter_limit", Type: "float64", Doc: "指定斜接长度限制。", Optional: true}, {Name: "dash_offset", Type: "float64", Doc: "指定虚线起始偏移量。", Optional: true}, {Name: "dash_pattern", Type: "[]float64", Doc: "指定虚线长度模式。", Optional: true}, {Name: "alpha", Type: "*uint8", Doc: "指定裁剪路径透明度。", Optional: true}, {Name: "stroke_color", Type: "*Color", Doc: "指定裁剪路径描边颜色。", Optional: true}, {Name: "fill_color", Type: "*Color", Doc: "指定裁剪路径填充颜色。", Optional: true}, }}, {Name: "ClipText", Path: "templates[].items[].clips[].areas[].text", Doc: "描述用于裁剪的文本。", Fields: []FieldDoc{ {Name: "boundary", Type: "Box", Doc: "指定裁剪文本边界。", Optional: false}, {Name: "ctm", Type: "[]float64", Doc: "指定裁剪文本的坐标变换矩阵。", Optional: true}, {Name: "font", Type: "string", Doc: "指定裁剪文本使用的字体名称。", Optional: true}, {Name: "size", Type: "float64", Doc: "指定裁剪文本字号。", Optional: true}, {Name: "value", Type: "string", Doc: "指定裁剪文本内容。", Optional: true}, {Name: "text_codes", Type: "[]TextCode", Doc: "定义裁剪文本代码。", Optional: true}, {Name: "stroke", Type: "bool", Doc: "指示是否绘制文本轮廓。", Optional: true}, {Name: "fill", Type: "*bool", Doc: "指示是否填充文本。", Optional: true}, {Name: "h_scale", Type: "float64", Doc: "指定文本水平方向缩放比例。", Optional: true}, {Name: "read_direction", Type: "int", Doc: "指定文本阅读方向。", Optional: true}, {Name: "char_direction", Type: "int", Doc: "指定字符排列方向。", Optional: true}, {Name: "weight", Type: "int", Doc: "指定文本字重。", Optional: true}, {Name: "italic", Type: "bool", Doc: "指示文本是否为斜体。", Optional: true}, {Name: "fill_color", Type: "*Color", Doc: "指定文本填充颜色。", Optional: true}, {Name: "stroke_color", Type: "*Color", Doc: "指定文本描边颜色。", Optional: true}, }}, {Name: "FlowCellBorders", Path: "flow.blocks[].table.cell_style.borders", Doc: "的空边继承默认边框,显式 width: 0 隐藏该侧边框。", Fields: []FieldDoc{ {Name: "top", Type: "*FlowTableBorder", Doc: "是上边框。", Optional: true}, {Name: "right", Type: "*FlowTableBorder", Doc: "是右边框。", Optional: true}, {Name: "bottom", Type: "*FlowTableBorder", Doc: "是下边框。", Optional: true}, {Name: "left", Type: "*FlowTableBorder", Doc: "是左边框。", Optional: true}, }}, {Name: "FlowTableBorder", Path: "flow.blocks[].table.cell_style.borders.top", Doc: "定义毫米单位的实色边框。", Fields: []FieldDoc{ {Name: "width", Type: "float64", Doc: "是边框宽度,零表示隐藏。", Optional: false}, {Name: "color", Type: "*Color", Doc: "是边框颜色,缺省继承主题边框颜色。", Optional: true}, }}, }
SchemaDocs 是 manifest 的结构体说明集合,由 internal/manifest/fielddocs 从 manifest.go 的文档注释提取,供 ofd-creator schema 输出字段参考文档。改动 manifest 字段后执行 go generate ./internal/manifest 更新。 每个结构体只展开一次,Path 记录首次到达它的示例路径。
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
// Event 指定触发动作的事件。
Event string `json:"event,omitempty" yaml:"event,omitempty" toml:"event,omitempty"`
// Region 定义动作触发区域。
Region *ActionRegion `json:"region,omitempty" yaml:"region,omitempty" toml:"region,omitempty"`
// URI 定义打开或跳转到 URI 的动作。
URI *URIAction `json:"uri,omitempty" yaml:"uri,omitempty" toml:"uri,omitempty"`
// Goto 定义跳转到页面或位置的动作。
Goto *GotoAction `json:"goto,omitempty" yaml:"goto,omitempty" toml:"goto,omitempty"`
// GotoA 定义跳转到附件的动作。
GotoA *GotoAAction `json:"goto_a,omitempty" yaml:"goto_a,omitempty" toml:"goto_a,omitempty"`
// Sound 定义播放声音资源的动作。
Sound *SoundAction `json:"sound,omitempty" yaml:"sound,omitempty" toml:"sound,omitempty"`
// Movie 定义播放媒体资源的动作。
Movie *MovieAction `json:"movie,omitempty" yaml:"movie,omitempty" toml:"movie,omitempty"`
}
Action 描述文档、页面或图元触发的动作。
type ActionArea ¶
type ActionArea struct {
// Start 指定路径起点。
Start Point `json:"start,omitempty" yaml:"start,omitempty" toml:"start,omitempty"`
// Commands 定义路径绘制命令。
Commands []RegionCommand `json:"commands,omitempty" yaml:"commands,omitempty" toml:"commands,omitempty"`
}
ActionArea 描述触发区域中的一条路径。
type ActionRegion ¶
type ActionRegion struct {
// Areas 定义动作区域中的路径。
Areas []ActionArea `json:"areas,omitempty" yaml:"areas,omitempty" toml:"areas,omitempty"`
}
ActionRegion 描述动作的触发区域。
type Annotation ¶
type Annotation struct {
// ID 标识批注。
ID uint64 `json:"id,omitempty" yaml:"id,omitempty" toml:"id,omitempty"`
// Type 指定批注类型。
Type string `json:"type,omitempty" yaml:"type,omitempty" toml:"type,omitempty"`
// Creator 指定批注创建者。
Creator string `json:"creator,omitempty" yaml:"creator,omitempty" toml:"creator,omitempty"`
// LastModDate 记录批注最后修改时间。
LastModDate string `json:"last_mod_date,omitempty" yaml:"last_mod_date,omitempty" toml:"last_mod_date,omitempty"`
// Visible 指示批注是否可见。
Visible *bool `json:"visible,omitempty" yaml:"visible,omitempty" toml:"visible,omitempty"`
// Subtype 指定批注子类型。
Subtype string `json:"subtype,omitempty" yaml:"subtype,omitempty" toml:"subtype,omitempty"`
// Print 指示批注是否随文档打印。
Print *bool `json:"print,omitempty" yaml:"print,omitempty" toml:"print,omitempty"`
// NoZoom 指示批注是否不随页面缩放。
NoZoom bool `json:"no_zoom,omitempty" yaml:"no_zoom,omitempty" toml:"no_zoom,omitempty"`
// NoRotate 指示批注是否不随页面旋转。
NoRotate bool `json:"no_rotate,omitempty" yaml:"no_rotate,omitempty" toml:"no_rotate,omitempty"`
// ReadOnly 指示批注是否只读。
ReadOnly *bool `json:"read_only,omitempty" yaml:"read_only,omitempty" toml:"read_only,omitempty"`
// Remark 记录批注说明。
Remark string `json:"remark,omitempty" yaml:"remark,omitempty" toml:"remark,omitempty"`
// Parameters 定义批注自定义参数。
Parameters []AnnotationParameter `json:"parameters,omitempty" yaml:"parameters,omitempty" toml:"parameters,omitempty"`
// Boundary 指定批注边界。
Boundary *Box `json:"boundary,omitempty" yaml:"boundary,omitempty" toml:"boundary,omitempty"`
// Items 定义批注包含的图元。
Items []Item `json:"items,omitempty" yaml:"items,omitempty" toml:"items,omitempty"`
}
Annotation 描述文档批注。
type AnnotationPage ¶
type AnnotationPage struct {
// Page 指定批注所属页码。
Page int `json:"page,omitempty" yaml:"page,omitempty" toml:"page,omitempty"`
// Items 定义该页面上的批注。
Items []Annotation `json:"items,omitempty" yaml:"items,omitempty" toml:"items,omitempty"`
}
AnnotationPage 描述某一页面上的批注集合。
type AnnotationParameter ¶
type AnnotationParameter struct {
// Name 指定批注参数名称。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// Value 指定批注参数值。
Value string `json:"value,omitempty" yaml:"value,omitempty" toml:"value,omitempty"`
}
AnnotationParameter 描述批注的自定义参数。
type Attachment ¶
type Attachment struct {
// ID 标识附件。
ID string `json:"id,omitempty" yaml:"id,omitempty" toml:"id,omitempty"`
// Name 指定附件名称。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// Format 指定附件格式。
Format string `json:"format,omitempty" yaml:"format,omitempty" toml:"format,omitempty"`
// Usage 说明附件用途。
Usage string `json:"usage,omitempty" yaml:"usage,omitempty" toml:"usage,omitempty"`
// File 指定附件文件路径。
File string `json:"file,omitempty" yaml:"file,omitempty" toml:"file,omitempty"`
// DataBase64 提供 Base64 编码的附件数据。
DataBase64 string `json:"data_base64,omitempty" yaml:"data_base64,omitempty" toml:"data_base64,omitempty"`
// FileName 指定附件在文档中的文件名。
FileName string `json:"file_name,omitempty" yaml:"file_name,omitempty" toml:"file_name,omitempty"`
// CreationDate 记录附件创建时间。
CreationDate string `json:"creation_date,omitempty" yaml:"creation_date,omitempty" toml:"creation_date,omitempty"`
// ModDate 记录附件最后修改时间。
ModDate string `json:"mod_date,omitempty" yaml:"mod_date,omitempty" toml:"mod_date,omitempty"`
// Visible 指示附件是否可见。
Visible *bool `json:"visible,omitempty" yaml:"visible,omitempty" toml:"visible,omitempty"`
}
Attachment 描述文档附件。
type AxialShading ¶
type AxialShading struct {
// MapType 指定渐变映射类型。
MapType string `json:"map_type,omitempty" yaml:"map_type,omitempty" toml:"map_type,omitempty"`
// MapUnit 指定渐变映射单位。
MapUnit float64 `json:"map_unit,omitempty" yaml:"map_unit,omitempty" toml:"map_unit,omitempty"`
// Extend 指定渐变端点的延伸方式。
Extend int `json:"extend,omitempty" yaml:"extend,omitempty" toml:"extend,omitempty"`
// StartPoint 指定渐变起点。
StartPoint string `json:"start_point,omitempty" yaml:"start_point,omitempty" toml:"start_point,omitempty"`
// EndPoint 指定渐变终点。
EndPoint string `json:"end_point,omitempty" yaml:"end_point,omitempty" toml:"end_point,omitempty"`
// Segments 定义渐变颜色停止点。
Segments []ColorStop `json:"segments,omitempty" yaml:"segments,omitempty" toml:"segments,omitempty"`
}
AxialShading 描述轴向渐变。
type Binding ¶ added in v0.1.6
type Binding struct {
// Path 从当前记录读取字段;$. 前缀读取根数据;内置序号 @index/@number、页码 @page/@pages、单据页码 @detail_page/@detail_pages。
Path string `json:"path" yaml:"path"`
// Aggregate 是 page_sum 或 record_sum,对当前页或整张单据的明细字段精确求和,仅用于 paginate 页面。
Aggregate string `json:"aggregate,omitempty" yaml:"aggregate,omitempty"`
// DecimalPlaces 是求和结果的小数位数(0—18),默认 2,精确求和后四舍五入。
DecimalPlaces *int `json:"decimal_places,omitempty" yaml:"decimal_places,omitempty"`
// Required 默认 true;false 时缺失或 null 字段移除该图元,空字符串也移除图元。
Required *bool `json:"required,omitempty" yaml:"required,omitempty"`
// Default 是缺失或 null 字段的默认字符串,优先于 required。
Default *string `json:"default,omitempty" yaml:"default,omitempty"`
// Overflow 是 error(默认)、wrap、shrink 或 ellipsis,仅用于文字。
Overflow string `json:"overflow,omitempty" yaml:"overflow,omitempty"`
// Align 是 left(默认)、center 或 right,仅用于文字。
Align string `json:"align,omitempty" yaml:"align,omitempty"`
// MinSize 是 shrink 的最小字号,单位毫米;shrink 时必须显式指定。
MinSize float64 `json:"min_size,omitempty" yaml:"min_size,omitempty"`
// MaxLines 是 wrap 的最大行数,0 表示仅按区域高度限制。
MaxLines int `json:"max_lines,omitempty" yaml:"max_lines,omitempty"`
// LineHeight 是 wrap 的行高倍率,默认 1.2。
LineHeight float64 `json:"line_height,omitempty" yaml:"line_height,omitempty"`
}
Binding 定义模板字段;长度和字号均为毫米,数据路径使用点分隔对象键。
type Bookmark ¶
type Bookmark struct {
// Name 指定书签名称。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// Goto 指定书签跳转目标。
Goto GotoAction `json:"goto,omitempty" yaml:"goto,omitempty" toml:"goto,omitempty"`
}
Bookmark 描述文档书签及其跳转目标。
type Box ¶
type Box struct {
// X 指定矩形左上角横坐标。
X float64 `json:"x,omitempty" yaml:"x,omitempty" toml:"x,omitempty"`
// Y 指定矩形左上角纵坐标。
Y float64 `json:"y,omitempty" yaml:"y,omitempty" toml:"y,omitempty"`
// Width 指定矩形宽度。
Width float64 `json:"width,omitempty" yaml:"width,omitempty" toml:"width,omitempty"`
// Height 指定矩形高度。
Height float64 `json:"height,omitempty" yaml:"height,omitempty" toml:"height,omitempty"`
}
Box 描述矩形区域。
type BuildOptions ¶ added in v0.1.3
type BuildOptions struct {
// StreamAssets 对通过 file 引用的封面、图片、多媒体、附件和页面图片使用
// 惰性数据来源,避免创建超大 OFD 时把资源整体读入内存。
StreamAssets bool
// LoadAsset 可选,从内存读取通过 file 引用的资源;为空时从磁盘资源根目录读取。
// 设置后 StreamAssets 的惰性来源会退化为内存字节来源。
LoadAsset func(name string) ([]byte, error)
}
BuildOptions 控制 manifest 到 creator 文档的转换行为。
type CGTransform ¶
type CGTransform struct {
// CodePosition 指定文本代码起始位置。
CodePosition int `json:"code_position,omitempty" yaml:"code_position,omitempty" toml:"code_position,omitempty"`
// CodeCount 指定映射的文本代码数量。
CodeCount int `json:"code_count,omitempty" yaml:"code_count,omitempty" toml:"code_count,omitempty"`
// GlyphCount 指定对应的字形数量。
GlyphCount int `json:"glyph_count,omitempty" yaml:"glyph_count,omitempty" toml:"glyph_count,omitempty"`
// Glyphs 指定对应字形编号列表。
Glyphs []int `json:"glyphs,omitempty" yaml:"glyphs,omitempty" toml:"glyphs,omitempty"`
}
CGTransform 描述文本代码与字形之间的映射关系。
type CaptionStyle ¶ added in v0.1.5
type CaptionStyle struct {
// Font 定义字体。
Font string `json:"font,omitempty" yaml:"font,omitempty" toml:"font,omitempty"`
// Size 定义字号。
Size float64 `json:"size,omitempty" yaml:"size,omitempty" toml:"size,omitempty"`
// Weight 定义字重。
Weight int `json:"weight,omitempty" yaml:"weight,omitempty" toml:"weight,omitempty"`
// Italic 指示是否斜体。
Italic bool `json:"italic,omitempty" yaml:"italic,omitempty" toml:"italic,omitempty"`
// Align 定义对齐方式。
Align string `json:"align,omitempty" yaml:"align,omitempty" toml:"align,omitempty"`
// Color 定义文字颜色。
Color *Color `json:"color,omitempty" yaml:"color,omitempty" toml:"color,omitempty"`
// Gap 定义说明文字与所标注对象之间的间距,单位毫米。
Gap float64 `json:"gap,omitempty" yaml:"gap,omitempty" toml:"gap,omitempty"`
}
CaptionStyle 定义表题样式。
type Clip ¶
type Clip struct {
// Areas 定义裁剪区域。
Areas []ClipArea `json:"areas,omitempty" yaml:"areas,omitempty" toml:"areas,omitempty"`
}
Clip 描述图元的裁剪区域集合。
type ClipArea ¶
type ClipArea struct {
// DrawParam 指定裁剪区域使用的绘制参数名称。
DrawParam string `json:"draw_param,omitempty" yaml:"draw_param,omitempty" toml:"draw_param,omitempty"`
// CTM 指定裁剪区域的坐标变换矩阵。
CTM []float64 `json:"ctm,omitempty" yaml:"ctm,omitempty" toml:"ctm,omitempty"`
// Path 定义路径裁剪内容。
Path *ClipPath `json:"path,omitempty" yaml:"path,omitempty" toml:"path,omitempty"`
// Text 定义文本裁剪内容。
Text *ClipText `json:"text,omitempty" yaml:"text,omitempty" toml:"text,omitempty"`
}
ClipArea 描述裁剪区域中的一个路径或文本区域。
type ClipPath ¶
type ClipPath struct {
// Boundary 指定裁剪路径边界。
Boundary Box `json:"boundary,omitempty" yaml:"boundary,omitempty" toml:"boundary,omitempty"`
// Name 指定裁剪路径名称。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// Visible 指示裁剪路径是否可见。
Visible *bool `json:"visible,omitempty" yaml:"visible,omitempty" toml:"visible,omitempty"`
// CTM 指定裁剪路径的坐标变换矩阵。
CTM []float64 `json:"ctm,omitempty" yaml:"ctm,omitempty" toml:"ctm,omitempty"`
// Data 指定裁剪路径数据。
Data string `json:"data,omitempty" yaml:"data,omitempty" toml:"data,omitempty"`
// Stroke 指示是否绘制裁剪路径轮廓。
Stroke bool `json:"stroke,omitempty" yaml:"stroke,omitempty" toml:"stroke,omitempty"`
// StrokeSet 指示是否显式设置描边属性。
StrokeSet *bool `json:"stroke_set,omitempty" yaml:"stroke_set,omitempty" toml:"stroke_set,omitempty"`
// Fill 指示是否填充裁剪路径。
Fill bool `json:"fill,omitempty" yaml:"fill,omitempty" toml:"fill,omitempty"`
// Rule 指定裁剪路径填充规则。
Rule string `json:"rule,omitempty" yaml:"rule,omitempty" toml:"rule,omitempty"`
// LineWidth 指定裁剪路径描边线宽。
LineWidth float64 `json:"line_width,omitempty" yaml:"line_width,omitempty" toml:"line_width,omitempty"`
// Cap 指定裁剪路径端点样式。
Cap string `json:"cap,omitempty" yaml:"cap,omitempty" toml:"cap,omitempty"`
// Join 指定裁剪路径连接样式。
Join string `json:"join,omitempty" yaml:"join,omitempty" toml:"join,omitempty"`
// MiterLimit 指定斜接长度限制。
MiterLimit float64 `json:"miter_limit,omitempty" yaml:"miter_limit,omitempty" toml:"miter_limit,omitempty"`
// DashOffset 指定虚线起始偏移量。
DashOffset float64 `json:"dash_offset,omitempty" yaml:"dash_offset,omitempty" toml:"dash_offset,omitempty"`
// DashPattern 指定虚线长度模式。
DashPattern []float64 `json:"dash_pattern,omitempty" yaml:"dash_pattern,omitempty" toml:"dash_pattern,omitempty"`
// Alpha 指定裁剪路径透明度。
Alpha *uint8 `json:"alpha,omitempty" yaml:"alpha,omitempty" toml:"alpha,omitempty"`
// StrokeColor 指定裁剪路径描边颜色。
StrokeColor *Color `json:"stroke_color,omitempty" yaml:"stroke_color,omitempty" toml:"stroke_color,omitempty"`
// FillColor 指定裁剪路径填充颜色。
FillColor *Color `json:"fill_color,omitempty" yaml:"fill_color,omitempty" toml:"fill_color,omitempty"`
}
ClipPath 描述用于裁剪的路径。
type ClipText ¶
type ClipText struct {
// Boundary 指定裁剪文本边界。
Boundary Box `json:"boundary" yaml:"boundary,omitempty" toml:"boundary,omitempty"`
// CTM 指定裁剪文本的坐标变换矩阵。
CTM []float64 `json:"ctm,omitempty" yaml:"ctm,omitempty" toml:"ctm,omitempty"`
// Font 指定裁剪文本使用的字体名称。
Font string `json:"font,omitempty" yaml:"font,omitempty" toml:"font,omitempty"`
// Size 指定裁剪文本字号。
Size float64 `json:"size,omitempty" yaml:"size,omitempty" toml:"size,omitempty"`
// Value 指定裁剪文本内容。
Value string `json:"value,omitempty" yaml:"value,omitempty" toml:"value,omitempty"`
// TextCodes 定义裁剪文本代码。
TextCodes []TextCode `json:"text_codes,omitempty" yaml:"text_codes,omitempty" toml:"text_codes,omitempty"`
// Stroke 指示是否绘制文本轮廓。
Stroke bool `json:"stroke,omitempty" yaml:"stroke,omitempty" toml:"stroke,omitempty"`
// Fill 指示是否填充文本。
Fill *bool `json:"fill,omitempty" yaml:"fill,omitempty" toml:"fill,omitempty"`
// HScale 指定文本水平方向缩放比例。
HScale float64 `json:"h_scale,omitempty" yaml:"h_scale,omitempty" toml:"h_scale,omitempty"`
// ReadDirection 指定文本阅读方向。
ReadDirection int `json:"read_direction,omitempty" yaml:"read_direction,omitempty" toml:"read_direction,omitempty"`
// CharDirection 指定字符排列方向。
CharDirection int `json:"char_direction,omitempty" yaml:"char_direction,omitempty" toml:"char_direction,omitempty"`
// Weight 指定文本字重。
Weight int `json:"weight,omitempty" yaml:"weight,omitempty" toml:"weight,omitempty"`
// Italic 指示文本是否为斜体。
Italic bool `json:"italic,omitempty" yaml:"italic,omitempty" toml:"italic,omitempty"`
// FillColor 指定文本填充颜色。
FillColor *Color `json:"fill_color,omitempty" yaml:"fill_color,omitempty" toml:"fill_color,omitempty"`
// StrokeColor 指定文本描边颜色。
StrokeColor *Color `json:"stroke_color,omitempty" yaml:"stroke_color,omitempty" toml:"stroke_color,omitempty"`
}
ClipText 描述用于裁剪的文本。
type Color ¶
type Color struct {
// R 指定红色分量。
R uint8 `json:"r,omitempty" yaml:"r,omitempty" toml:"r,omitempty"`
// G 指定绿色分量。
G uint8 `json:"g,omitempty" yaml:"g,omitempty" toml:"g,omitempty"`
// B 指定蓝色分量。
B uint8 `json:"b,omitempty" yaml:"b,omitempty" toml:"b,omitempty"`
// Components 指定颜色空间分量值。
Components []int `json:"components,omitempty" yaml:"components,omitempty" toml:"components,omitempty"`
// ColorSpace 指定颜色空间资源编号。
ColorSpace uint64 `json:"color_space,omitempty" yaml:"color_space,omitempty" toml:"color_space,omitempty"`
// Index 指定调色板颜色索引。
Index *int `json:"index,omitempty" yaml:"index,omitempty" toml:"index,omitempty"`
// Alpha 指定颜色透明度。
Alpha *uint8 `json:"alpha,omitempty" yaml:"alpha,omitempty" toml:"alpha,omitempty"`
// Axial 定义轴向渐变。
Axial *AxialShading `json:"axial,omitempty" yaml:"axial,omitempty" toml:"axial,omitempty"`
// Radial 定义径向渐变。
Radial *RadialShading `json:"radial,omitempty" yaml:"radial,omitempty" toml:"radial,omitempty"`
// Gouraud 定义三角网格渐变。
Gouraud *Gouraud `json:"gouraud,omitempty" yaml:"gouraud,omitempty" toml:"gouraud,omitempty"`
// LaGouraud 定义四边形网格渐变。
LaGouraud *LaGouraud `json:"la_gouraud,omitempty" yaml:"la_gouraud,omitempty" toml:"la_gouraud,omitempty"`
// Pattern 定义图案填充。
Pattern *Pattern `json:"pattern,omitempty" yaml:"pattern,omitempty" toml:"pattern,omitempty"`
}
Color 描述颜色及其渐变或图案填充信息。
type ColorSpace ¶
type ColorSpace struct {
// ID 标识颜色空间资源。
ID uint64 `json:"id,omitempty" yaml:"id,omitempty" toml:"id,omitempty"`
// Type 指定颜色空间类型。
Type string `json:"type,omitempty" yaml:"type,omitempty" toml:"type,omitempty"`
// BitsPerComponent 指定每个颜色分量的位数。
BitsPerComponent int `json:"bits_per_component,omitempty" yaml:"bits_per_component,omitempty" toml:"bits_per_component,omitempty"`
// Palette 定义颜色索引到颜色分量的映射。
Palette []string `json:"palette,omitempty" yaml:"palette,omitempty" toml:"palette,omitempty"`
// ProfileFile 指定颜色配置文件路径。
ProfileFile string `json:"profile_file,omitempty" yaml:"profile_file,omitempty" toml:"profile_file,omitempty"`
// ProfileBase64 提供 Base64 编码的颜色配置数据。
ProfileBase64 string `json:"profile_base64,omitempty" yaml:"profile_base64,omitempty" toml:"profile_base64,omitempty"`
// ProfileName 指定颜色配置文件名称。
ProfileName string `json:"profile_name,omitempty" yaml:"profile_name,omitempty" toml:"profile_name,omitempty"`
}
ColorSpace 描述文档使用的颜色空间资源。
type ColorStop ¶
type ColorStop struct {
// Position 指定颜色在渐变中的位置。省略时不写出,由渲染按首尾补齐。
Position *float64 `json:"position,omitempty" yaml:"position,omitempty" toml:"position,omitempty"`
// Color 指定该位置的颜色。
Color Color `json:"color" yaml:"color,omitempty" toml:"color,omitempty"`
}
ColorStop 描述渐变中的颜色停止点。
type Composite ¶
type Composite struct {
// ID 标识复合图形单元。
ID uint64 `json:"id,omitempty" yaml:"id,omitempty" toml:"id,omitempty"`
// Width 指定复合图形宽度。
Width float64 `json:"width,omitempty" yaml:"width,omitempty" toml:"width,omitempty"`
// Height 指定复合图形高度。
Height float64 `json:"height,omitempty" yaml:"height,omitempty" toml:"height,omitempty"`
// Thumbnail 指定缩略图资源编号。
Thumbnail uint64 `json:"thumbnail,omitempty" yaml:"thumbnail,omitempty" toml:"thumbnail,omitempty"`
// Substitution 指定替代图形资源编号。
Substitution uint64 `json:"substitution,omitempty" yaml:"substitution,omitempty" toml:"substitution,omitempty"`
// Items 定义复合图形中的图元。
Items []Item `json:"items,omitempty" yaml:"items,omitempty" toml:"items,omitempty"`
}
Composite 描述复合图形单元资源。
type CustomData ¶
type CustomData struct {
// Name 指定自定义数据名称。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// Value 指定自定义数据值。
Value string `json:"value,omitempty" yaml:"value,omitempty" toml:"value,omitempty"`
}
CustomData 描述文档自定义键值数据。
type CustomTag ¶
type CustomTag struct {
// NameSpace 指定自定义标签命名空间。
NameSpace string `json:"name_space,omitempty" yaml:"name_space,omitempty" toml:"name_space,omitempty"`
// Schema 指定架构文件路径。
Schema string `json:"schema,omitempty" yaml:"schema,omitempty" toml:"schema,omitempty"`
// SchemaBase64 提供 Base64 编码的架构数据。
SchemaBase64 string `json:"schema_base64,omitempty" yaml:"schema_base64,omitempty" toml:"schema_base64,omitempty"`
// SchemaName 指定架构在文档中的名称。
SchemaName string `json:"schema_name,omitempty" yaml:"schema_name,omitempty" toml:"schema_name,omitempty"`
// Data 指定自定义数据文件路径或文本数据。
Data string `json:"data,omitempty" yaml:"data,omitempty" toml:"data,omitempty"`
// DataBase64 提供 Base64 编码的自定义数据。
DataBase64 string `json:"data_base64,omitempty" yaml:"data_base64,omitempty" toml:"data_base64,omitempty"`
// DataName 指定自定义数据在文档中的名称。
DataName string `json:"data_name,omitempty" yaml:"data_name,omitempty" toml:"data_name,omitempty"`
}
CustomTag 描述文档自定义标签及其架构和数据。
type DetailColumn ¶ added in v0.1.6
type DetailColumn struct {
// Title 是每页重复的表头文字。
Title string `json:"title,omitempty" yaml:"title,omitempty"`
// Width 是列宽,必须大于两倍 padding。
Width float64 `json:"width" yaml:"width"`
// Bind 读取明细字段,可使用 @index/@number 表示整张单据内的行序号。
Bind Binding `json:"bind" yaml:"bind"`
}
DetailColumn 定义明细列;bind.path 相对于当前明细行,默认 overflow 为 wrap。
type DetailPagination ¶ added in v0.1.6
type DetailPagination struct {
// Path 是当前记录中的明细数组路径;$. 前缀从根数据读取。
Path string `json:"path" yaml:"path"`
// Area 是含表头的明细区域,放不下的完整行转入下一页。
Area Box `json:"area" yaml:"area"`
// Columns 定义表头、列宽和逐行文字绑定。
Columns []DetailColumn `json:"columns" yaml:"columns"`
// Font 指定完整字体资源,省略时嵌入 Go Regular。
Font string `json:"font,omitempty" yaml:"font,omitempty"`
// Size 是明细字号,默认 3.5mm。
Size float64 `json:"size,omitempty" yaml:"size,omitempty"`
// HeaderHeight 是重复表头高度,0 表示按文字实际高度计算且至少 8mm。
HeaderHeight float64 `json:"header_height,omitempty" yaml:"header_height,omitempty"`
// RowHeight 是最小行高,默认 8mm;换行会增高整行,不拆分单行。
RowHeight float64 `json:"row_height,omitempty" yaml:"row_height,omitempty"`
// Padding 是单元格四边内边距,默认 1.5mm,可显式设为 0。
Padding *float64 `json:"padding,omitempty" yaml:"padding,omitempty"`
// LineWidth 是网格线宽,默认 0.2mm。
LineWidth float64 `json:"line_width,omitempty" yaml:"line_width,omitempty"`
// BorderColor 是网格颜色,默认中性灰。
BorderColor *Color `json:"border_color,omitempty" yaml:"border_color,omitempty"`
// HeaderFill 是表头背景色,省略时使用浅灰。
HeaderFill *Color `json:"header_fill,omitempty" yaml:"header_fill,omitempty"`
}
DetailPagination 描述固定区域明细表;列宽之和必须等于 area.width,所有尺寸均为毫米。
type Document ¶
type Document struct {
// ID 标识文档。
ID string `json:"id,omitempty" yaml:"id,omitempty" toml:"id,omitempty"`
// Title 记录文档标题。
Title string `json:"title,omitempty" yaml:"title,omitempty" toml:"title,omitempty"`
// Author 记录文档作者。
Author string `json:"author,omitempty" yaml:"author,omitempty" toml:"author,omitempty"`
// Subject 记录文档主题。
Subject string `json:"subject,omitempty" yaml:"subject,omitempty" toml:"subject,omitempty"`
// Abstract 记录文档摘要。
Abstract string `json:"abstract,omitempty" yaml:"abstract,omitempty" toml:"abstract,omitempty"`
// Creator 记录创建文档的应用名称。
Creator string `json:"creator,omitempty" yaml:"creator,omitempty" toml:"creator,omitempty"`
// CreatorVersion 记录创建应用的版本。
CreatorVersion string `json:"creator_version,omitempty" yaml:"creator_version,omitempty" toml:"creator_version,omitempty"`
// PageSize 定义默认页面尺寸。
PageSize PageSize `json:"page_size" yaml:"page_size,omitempty" toml:"page_size,omitempty"`
// Actions 定义文档级动作。
Actions []Action `json:"actions,omitempty" yaml:"actions,omitempty" toml:"actions,omitempty"`
// Bookmarks 定义文档书签。
Bookmarks []Bookmark `json:"bookmarks,omitempty" yaml:"bookmarks,omitempty" toml:"bookmarks,omitempty"`
// Attachments 定义文档附件。
Attachments []Attachment `json:"attachments,omitempty" yaml:"attachments,omitempty" toml:"attachments,omitempty"`
// Extensions 定义文档扩展信息。
Extensions []Extension `json:"extensions,omitempty" yaml:"extensions,omitempty" toml:"extensions,omitempty"`
// Versions 定义文档版本记录。
Versions []Version `json:"versions,omitempty" yaml:"versions,omitempty" toml:"versions,omitempty"`
// Annotations 定义按页面组织的批注。
Annotations []AnnotationPage `json:"annotations,omitempty" yaml:"annotations,omitempty" toml:"annotations,omitempty"`
// DocUsage 说明文档用途。
DocUsage string `json:"doc_usage,omitempty" yaml:"doc_usage,omitempty" toml:"doc_usage,omitempty"`
// Keywords 记录文档关键词。
Keywords []string `json:"keywords,omitempty" yaml:"keywords,omitempty" toml:"keywords,omitempty"`
// CustomData 定义文档自定义键值数据。
CustomData []CustomData `json:"custom_data,omitempty" yaml:"custom_data,omitempty" toml:"custom_data,omitempty"`
// Cover 指定封面文件路径。
Cover string `json:"cover,omitempty" yaml:"cover,omitempty" toml:"cover,omitempty"`
// CoverBase64 提供 Base64 编码的封面数据。
CoverBase64 string `json:"cover_base64,omitempty" yaml:"cover_base64,omitempty" toml:"cover_base64,omitempty"`
// CoverName 指定封面在文档中的名称。
CoverName string `json:"cover_name,omitempty" yaml:"cover_name,omitempty" toml:"cover_name,omitempty"`
// DocType 指定 OFD.xml 根节点的 DocType 取值,决定文档遵循的 profile。
// 留空或 "OFD" 为 GB/T 33190—2016 的基础 profile;"OFD-A" 是
// GB/T 42133—2022《信息技术 OFD档案应用指南》规定的档案长期保存 profile,
// "OFD-H" 是 GB/T 48666-2026《电子病历版式文档技术要求》
// 规定的电子病历 profile。取值区分大小写,未知取值在生成阶段报错。
DocType string `json:"doc_type,omitempty" yaml:"doc_type,omitempty" toml:"doc_type,omitempty"`
// CreationDate 记录文档创建时间。
CreationDate string `json:"creation_date,omitempty" yaml:"creation_date,omitempty" toml:"creation_date,omitempty"`
// ModDate 记录文档最后修改时间。
ModDate string `json:"mod_date,omitempty" yaml:"mod_date,omitempty" toml:"mod_date,omitempty"`
// Area 定义文档页面区域。
Area *PageArea `json:"area,omitempty" yaml:"area,omitempty" toml:"area,omitempty"`
// DefaultCS 指定文档默认颜色空间编号。
DefaultCS uint64 `json:"default_cs,omitempty" yaml:"default_cs,omitempty" toml:"default_cs,omitempty"`
// Preferences 定义文档查看偏好。
Preferences *Preferences `json:"preferences,omitempty" yaml:"preferences,omitempty" toml:"preferences,omitempty"`
// Permissions 定义文档访问和操作权限。
Permissions *Permissions `json:"permissions,omitempty" yaml:"permissions,omitempty" toml:"permissions,omitempty"`
// Outlines 定义文档大纲。
Outlines []Outline `json:"outlines,omitempty" yaml:"outlines,omitempty" toml:"outlines,omitempty"`
// Signatures 定义文档数字签名。
Signatures []Signature `json:"signatures,omitempty" yaml:"signatures,omitempty" toml:"signatures,omitempty"`
}
Document 描述 OFD 文档及其元数据、资源和页面内容。
type DrawParam ¶
type DrawParam struct {
// Name 指定绘制参数名称。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// Relative 指定参数相对的坐标或对象。
Relative string `json:"relative,omitempty" yaml:"relative,omitempty" toml:"relative,omitempty"`
// LineWidth 指定线宽。
LineWidth float64 `json:"line_width,omitempty" yaml:"line_width,omitempty" toml:"line_width,omitempty"`
// Join 指定线段连接样式。
Join string `json:"join,omitempty" yaml:"join,omitempty" toml:"join,omitempty"`
// Cap 指定线段端点样式。
Cap string `json:"cap,omitempty" yaml:"cap,omitempty" toml:"cap,omitempty"`
// DashOffset 指定虚线起始偏移量。
DashOffset float64 `json:"dash_offset,omitempty" yaml:"dash_offset,omitempty" toml:"dash_offset,omitempty"`
// DashPattern 指定虚线长度模式。
DashPattern []float64 `json:"dash_pattern,omitempty" yaml:"dash_pattern,omitempty" toml:"dash_pattern,omitempty"`
// MiterLimit 指定斜接长度限制。
MiterLimit float64 `json:"miter_limit,omitempty" yaml:"miter_limit,omitempty" toml:"miter_limit,omitempty"`
// FillColor 指定填充颜色。
FillColor *Color `json:"fill_color,omitempty" yaml:"fill_color,omitempty" toml:"fill_color,omitempty"`
// StrokeColor 指定描边颜色。
StrokeColor *Color `json:"stroke_color,omitempty" yaml:"stroke_color,omitempty" toml:"stroke_color,omitempty"`
}
DrawParam 描述图形绘制参数。
type Extension ¶
type Extension struct {
// AppName 指定扩展信息来源应用名称。
AppName string `json:"app_name,omitempty" yaml:"app_name,omitempty" toml:"app_name,omitempty"`
// Company 指定扩展信息来源公司。
Company string `json:"company,omitempty" yaml:"company,omitempty" toml:"company,omitempty"`
// AppVersion 指定来源应用版本。
AppVersion string `json:"app_version,omitempty" yaml:"app_version,omitempty" toml:"app_version,omitempty"`
// Date 记录扩展信息生成时间。
Date string `json:"date,omitempty" yaml:"date,omitempty" toml:"date,omitempty"`
// RefID 指定扩展信息引用标识。
RefID uint64 `json:"ref_id,omitempty" yaml:"ref_id,omitempty" toml:"ref_id,omitempty"`
// Data 指定扩展数据。
Data string `json:"data,omitempty" yaml:"data,omitempty" toml:"data,omitempty"`
// DataXML 指定扩展 XML 数据。
DataXML string `json:"data_xml,omitempty" yaml:"data_xml,omitempty" toml:"data_xml,omitempty"`
// DataFile 指定扩展数据文件路径。
DataFile string `json:"data_file,omitempty" yaml:"data_file,omitempty" toml:"data_file,omitempty"`
// DataFileBase64 提供 Base64 编码的扩展文件数据。
DataFileBase64 string `json:"data_file_base64,omitempty" yaml:"data_file_base64,omitempty" toml:"data_file_base64,omitempty"`
// DataName 指定扩展数据文件名称。
DataName string `json:"data_name,omitempty" yaml:"data_name,omitempty" toml:"data_name,omitempty"`
// Properties 定义扩展属性。
Properties []ExtensionProperty `json:"properties,omitempty" yaml:"properties,omitempty" toml:"properties,omitempty"`
}
Extension 描述文档扩展信息。
type ExtensionProperty ¶
type ExtensionProperty struct {
// Name 指定属性名称。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// Type 指定属性类型。
Type string `json:"type,omitempty" yaml:"type,omitempty" toml:"type,omitempty"`
// Value 指定属性值。
Value string `json:"value,omitempty" yaml:"value,omitempty" toml:"value,omitempty"`
}
ExtensionProperty 描述扩展信息的属性。
type FieldDoc ¶ added in v0.1.5
type FieldDoc struct {
// Name 是相对所属结构体的键名,也是 manifest 里的字段名。
Name string
// Type 是该字段的 Go 类型,数组和指针保留书写形式。
Type string
// Doc 是去掉字段名前缀后的字段说明。
Doc string
// Optional 表示该字段的 json tag 带 omitempty,未设置时零值即不输出。
Optional bool
}
FieldDoc 是单个 manifest 字段的参考信息。
type Flow ¶ added in v0.1.6
type Flow struct {
// Profile 选择专用版式,支持 gbt9704;与 theme 互斥,需同时提供 official.fonts。
Profile string `json:"profile,omitempty" yaml:"profile,omitempty"`
// Official 是 GB/T 9704—2012 常规公文的字体、版头、落款与版记配置。
Official *FlowOfficial `json:"official,omitempty" yaml:"official,omitempty"`
// Theme 选择 material(默认)、material2、material3、fluent2、carbon 或 bootstrap5 印刷主题;字体资源仍由 font、heading_font 等字段配置。
Theme string `json:"theme,omitempty" yaml:"theme,omitempty"`
// Columns 配置等宽分栏,省略时单栏。
Columns *FlowColumns `json:"columns,omitempty" yaml:"columns,omitempty"`
// Styles 注册命名文字样式,可由块或单元格 style.based_on 引用。
Styles []FlowNamedStyle `json:"styles,omitempty" yaml:"styles,omitempty"`
// Footnotes 注册页底注释,按正文、列表或表格中的首次引用顺序编号。
Footnotes []FlowFootnote `json:"footnotes,omitempty" yaml:"footnotes,omitempty"`
// FootnoteStyle 覆盖默认脚注样式(9pt、1.3 倍行高),支持 based_on。
FootnoteStyle *FlowStyle `json:"footnote_style,omitempty" yaml:"footnote_style,omitempty"`
// Font 指定正文、图注与表格的字体资源名,缺省使用内置 Go 字体。
Font string `json:"font,omitempty" yaml:"font,omitempty"`
// HeadingFont 指定标题字体,缺省继承显式 font,否则使用内置 Go 粗体。
HeadingFont string `json:"heading_font,omitempty" yaml:"heading_font,omitempty"`
// BoldFont 是正文字体族粗体的简写,font_families 中的显式族关系优先。
BoldFont string `json:"bold_font,omitempty" yaml:"bold_font,omitempty"`
// ItalicFont 是正文字体族斜体的简写。
ItalicFont string `json:"italic_font,omitempty" yaml:"italic_font,omitempty"`
// BoldItalicFont 是正文字体族粗斜体的简写。
BoldItalicFont string `json:"bold_italic_font,omitempty" yaml:"bold_italic_font,omitempty"`
// FallbackFonts 是按字符覆盖依次尝试的回退字体资源名。
FallbackFonts []string `json:"fallback_fonts,omitempty" yaml:"fallback_fonts,omitempty"`
// FontFaces 按字体资源名选择 TTC/OTC 中从 0 开始的字体面,缺省为 0,单字体文件只接受 0。
FontFaces map[string]int `json:"font_faces,omitempty" yaml:"font_faces,omitempty"`
// FontFamilies 显式关联同一字体族的实际字体资源,字重与斜体在各自字体族内匹配。
FontFamilies []FlowFontFamily `json:"font_families,omitempty" yaml:"font_families,omitempty"`
// Margins 定义毫米单位的页边距,省略时四边均为 20mm。
Margins *FlowMargins `json:"margins,omitempty" yaml:"margins,omitempty"`
// BodySize 是正文字号,单位磅,省略时沿用主题(fluent2 为 10.5,其余普通主题为 12)。
BodySize float64 `json:"body_size,omitempty" yaml:"body_size,omitempty"`
// LineHeight 是正文行高倍率,省略时沿用主题(material 为 1.6,fluent2 为 20/14,其余普通主题为 1.5)。
LineHeight float64 `json:"line_height,omitempty" yaml:"line_height,omitempty"`
// PageNumbers 控制页码显示;省略或 null 时普通主题默认关闭,gbt9704 默认开启,显式 false 可关闭。
PageNumbers *bool `json:"page_numbers,omitempty" yaml:"page_numbers,omitempty"`
// Header 是页眉文字,支持 {page} 与 {pages} 占位符,上页边距须至少 8mm。
Header string `json:"header,omitempty" yaml:"header,omitempty"`
Footer string `json:"footer,omitempty" yaml:"footer,omitempty"`
// GenerateOutlines 按标题层级生成标准大纲,追加在 document.outlines 后,跳转位置由最终分页确定。
GenerateOutlines bool `json:"generate_outlines,omitempty" yaml:"generate_outlines,omitempty"`
// ReferencePageNumbers 选择目录与 page_ref 使用 physical(默认物理页码)或 section(节内显示页码)。
ReferencePageNumbers string `json:"reference_page_numbers,omitempty" yaml:"reference_page_numbers,omitempty"`
// Blocks 是按顺序排列的逻辑内容。
Blocks []FlowBlock `json:"blocks,omitempty" yaml:"blocks,omitempty"`
}
Flow 定义流式创作设置;页面尺寸取 document.page_size,字体取 resources.fonts。
type FlowBlock ¶ added in v0.1.6
type FlowBlock struct {
// ID 是文档内唯一内容标识,不含空白,不能以 __flow_ 开头;换页、换栏和分节块不能设置。
ID string `json:"id,omitempty" yaml:"id,omitempty"`
// Type 是 paragraph、heading、recipient、list_item、image、table、fixed、toc、section、page_break 或 column_break,缺省 paragraph;recipient 为公文主送机关。
Type string `json:"type,omitempty" yaml:"type,omitempty"`
// Text 是纯文本内容,与 runs 互斥。
Text string `json:"text,omitempty" yaml:"text,omitempty"`
// Runs 是带局部样式的文字片段,与 text 互斥。
Runs []FlowRun `json:"runs,omitempty" yaml:"runs,omitempty"`
// Level 是标题级别,heading 必须为 1 到 6。
Level int `json:"level,omitempty" yaml:"level,omitempty"`
// Marker 是列表标记,list_item 缺省使用圆点。
Marker string `json:"marker,omitempty" yaml:"marker,omitempty"`
// Style 覆盖主题样式。
Style *FlowStyle `json:"style,omitempty" yaml:"style,omitempty"`
// KeepWithNext 尽量与后续内容的开头保持同页;连续设置会组成跟随链,标题和公文主送机关默认启用。
KeepWithNext bool `json:"keep_with_next,omitempty" yaml:"keep_with_next,omitempty"`
// KeepTogether 能放入完整一页时尽量整块同页。
KeepTogether bool `json:"keep_together,omitempty" yaml:"keep_together,omitempty"`
// PageBreakBefore 在此块之前换页。
PageBreakBefore bool `json:"page_break_before,omitempty" yaml:"page_break_before,omitempty"`
// PageBreakAfter 在此块之后换页。
PageBreakAfter bool `json:"page_break_after,omitempty" yaml:"page_break_after,omitempty"`
// Orphans 是段落跨页时前页至少保留的行数,缺省 2。
Orphans int `json:"orphans,omitempty" yaml:"orphans,omitempty"`
// Widows 是段落跨页时后页至少保留的行数,缺省 2。
Widows int `json:"widows,omitempty" yaml:"widows,omitempty"`
// Image 是图片与图注,type 为 image 时使用。
Image *FlowImage `json:"image,omitempty" yaml:"image,omitempty"`
// Table 是简单网格表格,type 为 table 时使用。
Table *FlowTable `json:"table,omitempty" yaml:"table,omitempty"`
// Fixed 是整块分页的固定图元区域。
Fixed *FlowFixed `json:"fixed,omitempty" yaml:"fixed,omitempty"`
// TOC 配置 type 为 toc 的自动目录,支持多页条目和最终物理页码。
TOC *FlowTOC `json:"toc,omitempty" yaml:"toc,omitempty"`
// Section 配置 type 为 section 的分节块,后续内容从新页开始。
Section *FlowSection `json:"section,omitempty" yaml:"section,omitempty"`
}
FlowBlock 是无需坐标的内容块。
type FlowCellBorders ¶ added in v0.1.6
type FlowCellBorders struct {
// Top 是上边框。
Top *FlowTableBorder `json:"top,omitempty" yaml:"top,omitempty"`
// Right 是右边框。
Right *FlowTableBorder `json:"right,omitempty" yaml:"right,omitempty"`
// Bottom 是下边框。
Bottom *FlowTableBorder `json:"bottom,omitempty" yaml:"bottom,omitempty"`
// Left 是左边框。
Left *FlowTableBorder `json:"left,omitempty" yaml:"left,omitempty"`
}
FlowCellBorders 的空边继承默认边框,显式 width: 0 隐藏该侧边框。
type FlowCellStyle ¶ added in v0.1.6
type FlowCellStyle struct {
// Fill 是背景色,覆盖表头或隔行底色。
Fill *Color `json:"fill,omitempty" yaml:"fill,omitempty"`
// Padding 是四边内边距,显式空对象表示零内边距,缺省四边 1.5mm。
Padding *FlowMargins `json:"padding,omitempty" yaml:"padding,omitempty"`
// VerticalAlign 为 top、middle 或 bottom,缺省 top。
VerticalAlign string `json:"vertical_align,omitempty" yaml:"vertical_align,omitempty"`
// Borders 按侧覆盖默认边框,相邻单元格的边框各自在内部绘制。
Borders *FlowCellBorders `json:"borders,omitempty" yaml:"borders,omitempty"`
}
FlowCellStyle 定义单元格外观,空字段继承默认设置。
type FlowColumns ¶ added in v0.1.6
type FlowColumns struct {
// Count 是栏数,0 或 1 表示单栏,支持 2 到 8 栏。
Count int `json:"count,omitempty" yaml:"count,omitempty"`
// Gap 是毫米单位的栏间距,须为有限非负数,零表示无栏间距。
Gap float64 `json:"gap,omitempty" yaml:"gap,omitempty"`
// Balance 在多栏节末页按合法断点重排栏高;含显式换栏的末页保持原布局。
Balance bool `json:"balance,omitempty" yaml:"balance,omitempty"`
}
FlowColumns 定义从左到右顺序流动的等宽栏,可选择平衡节末页。
type FlowFixed ¶ added in v0.1.6
type FlowFixed struct {
// Width 是预留宽度,省略时使用当前栏宽,单栏时为版心宽度;超宽时报错。
Width float64 `json:"width,omitempty" yaml:"width,omitempty"`
// Height 是必须给出的正数高度,不含图注。
Height float64 `json:"height" yaml:"height"`
// Align 为 left(默认)、center 或 right。
Align string `json:"align,omitempty" yaml:"align,omitempty"`
// Items 是相对块左上角的图元,支持 text、path、image、composite、page-block。
Items []Item `json:"items" yaml:"items"`
// Caption 是区域下方的图注。
Caption string `json:"caption,omitempty" yaml:"caption,omitempty"`
// Numbered 与 image 共用连续图编号。
Numbered bool `json:"numbered,omitempty" yaml:"numbered,omitempty"`
// CaptionPrefix 是编号前缀,缺省 Figure;需要 numbered。
CaptionPrefix string `json:"caption_prefix,omitempty" yaml:"caption_prefix,omitempty"`
}
FlowFixed 将原始图元作为固定区域插入流式文档,长度与图元字号均为毫米。
type FlowFontFamily ¶ added in v0.1.6
type FlowFontFamily struct {
// Regular 是必填的常规字体资源名。
Regular string `json:"regular" yaml:"regular"`
// Bold 是粗体字体资源名,省略时保留原字体。
Bold string `json:"bold,omitempty" yaml:"bold,omitempty"`
// Italic 是斜体字体资源名,省略时保留原字体。
Italic string `json:"italic,omitempty" yaml:"italic,omitempty"`
// BoldItalic 是粗斜体字体资源名,缺少时按粗体、斜体、原字体顺序选择。
BoldItalic string `json:"bold_italic,omitempty" yaml:"bold_italic,omitempty"`
}
FlowFontFamily 关联同一字体族的四种实际字体面。
type FlowFootnote ¶ added in v0.1.6
type FlowFootnote struct {
// ID 是脚注定义内唯一的名称,不含空白或控制字符。
ID string `json:"id" yaml:"id"`
// Text 是注释纯文本,与 runs 互斥。
Text string `json:"text,omitempty" yaml:"text,omitempty"`
// Runs 是带样式和链接的注释片段,不能嵌套脚注。
Runs []FlowRun `json:"runs,omitempty" yaml:"runs,omitempty"`
// Style 覆盖全局脚注样式,支持 based_on 和显式零间距。
Style *FlowStyle `json:"style,omitempty" yaml:"style,omitempty"`
}
FlowFootnote 定义与引用行或表格行组同栏的脚注,同栏重复引用只排一次。
type FlowImage ¶ added in v0.1.6
type FlowImage struct {
// File 是资源根目录内的图片路径,与 data_base64 互斥。
File string `json:"file,omitempty" yaml:"file,omitempty"`
// DataBase64 是 Base64 图片数据,与 file 互斥。
DataBase64 string `json:"data_base64,omitempty" yaml:"data_base64,omitempty"`
// Width 是图片宽度,单位毫米,缺省按原图比例推算。
Width float64 `json:"width,omitempty" yaml:"width,omitempty"`
// Height 是图片高度,单位毫米,缺省按原图比例推算。
Height float64 `json:"height,omitempty" yaml:"height,omitempty"`
// Caption 是图片下方的说明文字。
Caption string `json:"caption,omitempty" yaml:"caption,omitempty"`
// Numbered 为图注添加连续编号,图片与表格分别计数。
Numbered bool `json:"numbered,omitempty" yaml:"numbered,omitempty"`
// CaptionPrefix 是编号前缀,缺省 Figure;需要 numbered。
CaptionPrefix string `json:"caption_prefix,omitempty" yaml:"caption_prefix,omitempty"`
}
FlowImage 定义图片资源及排版尺寸。
type FlowMargins ¶ added in v0.1.6
type FlowMargins struct {
// Top 是上页边距。
Top float64 `json:"top,omitempty" yaml:"top,omitempty"`
// Right 是右页边距。
Right float64 `json:"right,omitempty" yaml:"right,omitempty"`
// Bottom 是下页边距。
Bottom float64 `json:"bottom,omitempty" yaml:"bottom,omitempty"`
// Left 是左页边距。
Left float64 `json:"left,omitempty" yaml:"left,omitempty"`
}
FlowMargins 是毫米单位的页边距。
type FlowNamedStyle ¶ added in v0.1.6
type FlowNamedStyle struct {
// Name 是引用此样式的名称。
Name string `json:"name" yaml:"name"`
// Style 定义样式字段,可通过 based_on 继承其他命名样式,最多 64 层。
Style FlowStyle `json:"style" yaml:"style"`
}
FlowNamedStyle 是可复用的文字样式,名称在文档内唯一且不含空白。
type FlowOfficial ¶ added in v0.1.6
type FlowOfficial struct {
// Fonts 指定五类专用字体资源;调用方负责提供对应字形。
Fonts FlowOfficialFonts `json:"fonts" yaml:"fonts"`
// Letterhead 定义仅在首页出现的版头。
Letterhead *FlowOfficialLetterhead `json:"letterhead,omitempty" yaml:"letterhead,omitempty"`
// Signature 定义不加盖印章的单一机关落款。
Signature *FlowOfficialSignature `json:"signature,omitempty" yaml:"signature,omitempty"`
// Colophon 定义锚定末页版心下边缘的版记。
Colophon *FlowOfficialColophon `json:"colophon,omitempty" yaml:"colophon,omitempty"`
}
FlowOfficial 定义常规公文专用要素;启用时使用 A4 和 156×225mm 版心。
type FlowOfficialColophon ¶ added in v0.1.6
type FlowOfficialColophon struct {
// Cc 是抄送机关,不含自动添加的“抄送:”。
Cc string `json:"cc,omitempty" yaml:"cc,omitempty"`
// IssuedBy 是印发机关。
IssuedBy string `json:"issued_by,omitempty" yaml:"issued_by,omitempty"`
// IssuedDate 是印发日期,不含自动添加的“印发”。
IssuedDate string `json:"issued_date,omitempty" yaml:"issued_date,omitempty"`
}
FlowOfficialColophon 是末页版记,行宽不足时报错或按悬挂缩进换行。
type FlowOfficialFonts ¶ added in v0.1.6
type FlowOfficialFonts struct {
// Body 是三号正文及版记使用的仿宋字体资源。
Body string `json:"body" yaml:"body"`
// Title 是标题和发文机关标志使用的小标宋字体资源。
Title string `json:"title" yaml:"title"`
// Hei 是第一层结构序数、密级及紧急程度使用的黑体字体资源。
Hei string `json:"hei" yaml:"hei"`
// Kai 是第二层结构序数和签发人姓名使用的楷体字体资源。
Kai string `json:"kai" yaml:"kai"`
// Song 是四号半角页码使用的宋体字体资源。
Song string `json:"song" yaml:"song"`
}
FlowOfficialFonts 引用 resources.fonts 中已注册的字体,不按资源名猜测实际字形。
type FlowOfficialLetterhead ¶ added in v0.1.6
type FlowOfficialLetterhead struct {
// Org 是发文机关标志,不自动追加“文件”。
Org string `json:"org" yaml:"org"`
// DocNo 是完整发文字号,由调用方提供规范文字。
DocNo string `json:"doc_no,omitempty" yaml:"doc_no,omitempty"`
// Signatory 是单个签发人姓名,非空时采用上行文并排布局。
Signatory string `json:"signatory,omitempty" yaml:"signatory,omitempty"`
// SerialNo 是份号。
SerialNo string `json:"serial_no,omitempty" yaml:"serial_no,omitempty"`
// Security 是密级和保密期限。
Security string `json:"security,omitempty" yaml:"security,omitempty"`
// Urgency 是紧急程度。
Urgency string `json:"urgency,omitempty" yaml:"urgency,omitempty"`
// OrgSize 是机关标志字号,单位磅,缺省 32;过宽时报错。
OrgSize float64 `json:"org_size,omitempty" yaml:"org_size,omitempty"`
}
FlowOfficialLetterhead 是首页常规版头;不含联合行文、信函或命令专用格式。
type FlowOfficialSignature ¶ added in v0.1.6
type FlowOfficialSignature struct {
// Org 是发文机关署名。
Org string `json:"org,omitempty" yaml:"org,omitempty"`
// Date 是完整成文日期,由调用方使用规范日期文字。
Date string `json:"date,omitempty" yaml:"date,omitempty"`
}
FlowOfficialSignature 是不加盖印章的单一机关落款。
type FlowRun ¶ added in v0.1.6
type FlowRun struct {
// Text 是文字内容。
Text string `json:"text" yaml:"text"`
// Font 显式指定字体资源名,空值继承块级字体。
Font string `json:"font,omitempty" yaml:"font,omitempty"`
// Bold 选择 flow.bold_font 配置的字体面。
Bold bool `json:"bold,omitempty" yaml:"bold,omitempty"`
// Italic 选择 flow.italic_font 配置的字体面。
Italic bool `json:"italic,omitempty" yaml:"italic,omitempty"`
// Strike 绘制删除线。
Strike bool `json:"strike,omitempty" yaml:"strike,omitempty"`
// Href 定义此片段的点击链接。
Href string `json:"href,omitempty" yaml:"href,omitempty"`
// Target 指向内容块的 id,与 href 互斥。
Target string `json:"target,omitempty" yaml:"target,omitempty"`
// PageRef 按 reference_page_numbers 显示目标最终页码并提供跳转,与 text、href、target 及其他引用字段互斥。
PageRef string `json:"page_ref,omitempty" yaml:"page_ref,omitempty"`
// CaptionRef 显示带编号图表的标签并跳转,与 text、href、target 及其他引用字段互斥。
CaptionRef string `json:"caption_ref,omitempty" yaml:"caption_ref,omitempty"`
// TitleRef 显示章节标题或完整图表题注并跳转,与 text、href、target、page_ref、caption_ref、footnote 互斥。
TitleRef string `json:"title_ref,omitempty" yaml:"title_ref,omitempty"`
// Footnote 显示脚注编号上标(所在文字 75% 字号、上移 0.3em),与 text、href、target 及其他引用字段互斥。
Footnote string `json:"footnote,omitempty" yaml:"footnote,omitempty"`
}
FlowRun 是段落内的同样式文字片段。
type FlowSection ¶ added in v0.1.6
type FlowSection struct {
// PageSize 覆盖纸张尺寸,单位毫米,须同时给出正数 width 和 height。
PageSize *FlowSectionSize `json:"page_size,omitempty" yaml:"page_size,omitempty"`
// Margins 覆盖四边页边距,单位毫米,零值表示零边距。
Margins *FlowMargins `json:"margins,omitempty" yaml:"margins,omitempty"`
// Columns 覆盖后续页面的分栏设置,省略时继承前节;count: 1 恢复单栏。
Columns *FlowColumns `json:"columns,omitempty" yaml:"columns,omitempty"`
// Header 覆盖页眉,空字符串清除前节页眉。
Header *string `json:"header,omitempty" yaml:"header,omitempty"`
Footer *string `json:"footer,omitempty" yaml:"footer,omitempty"`
// PageNumbers 控制自动页码显示,false 可隐藏封面页码。
PageNumbers *bool `json:"page_numbers,omitempty" yaml:"page_numbers,omitempty"`
// StartPageNumber 从正数开始重新编号,省略时接续前节。
StartPageNumber *int `json:"start_page_number,omitempty" yaml:"start_page_number,omitempty"`
// PageNumberStyle 是 decimal、roman 或 ROMAN,省略继承前节;罗马编号支持 1 到 3999。
PageNumberStyle string `json:"page_number_style,omitempty" yaml:"page_number_style,omitempty"`
// PageNumberPrefix 是编号前缀,如 A-,空字符串清除前缀。
PageNumberPrefix *string `json:"page_number_prefix,omitempty" yaml:"page_number_prefix,omitempty"`
// FirstPageHeader 只覆盖本节首页页眉,不继承到下一节。
FirstPageHeader *string `json:"first_page_header,omitempty" yaml:"first_page_header,omitempty"`
FirstPageFooter *string `json:"first_page_footer,omitempty" yaml:"first_page_footer,omitempty"`
// HideFirstPageNumber 隐藏本节首页自动追加的页码,首页仍占用编号。
HideFirstPageNumber bool `json:"hide_first_page_number,omitempty" yaml:"hide_first_page_number,omitempty"`
}
FlowSection 按需覆盖后续页面设置;省略字段继承前节,空字符串和 false 可显式清除。
type FlowSectionSize ¶ added in v0.1.6
type FlowSectionSize struct {
// Width 是纸张宽度。
Width float64 `json:"width" yaml:"width"`
// Height 是纸张高度。
Height float64 `json:"height" yaml:"height"`
}
FlowSectionSize 是毫米单位的分节纸张尺寸。
type FlowStyle ¶ added in v0.1.6
type FlowStyle struct {
// BasedOn 是在当前字段之前应用的命名样式。
BasedOn string `json:"based_on,omitempty" yaml:"based_on,omitempty"`
// Font 是字体资源名。
Font string `json:"font,omitempty" yaml:"font,omitempty"`
// Size 是字号,单位磅。
Size *float64 `json:"size,omitempty" yaml:"size,omitempty"`
// LineHeight 是行高倍率。
LineHeight *float64 `json:"line_height,omitempty" yaml:"line_height,omitempty"`
// SpaceBefore 是段前间距。
SpaceBefore *float64 `json:"space_before,omitempty" yaml:"space_before,omitempty"`
// SpaceAfter 是段后间距。
SpaceAfter *float64 `json:"space_after,omitempty" yaml:"space_after,omitempty"`
// FirstLineIndent 是首行缩进。
FirstLineIndent *float64 `json:"first_line_indent,omitempty" yaml:"first_line_indent,omitempty"`
// Align 是 left、center、right 或 justify;justify 仅伸展自动换行的行,段末和显式换行保持自然宽度。
Align string `json:"align,omitempty" yaml:"align,omitempty"`
// Color 是文字颜色。
Color *Color `json:"color,omitempty" yaml:"color,omitempty"`
}
FlowStyle 覆盖文字样式,省略或 null 字段继承;显式零间距和零缩进会清除上层值。 字号为磅,行高为倍率,其余长度为毫米;字号、行高不能显式设为零。
type FlowTOC ¶ added in v0.1.6
type FlowTOC struct {
// Title 是目录标题,显式空值表示省略标题。
Title string `json:"title,omitempty" yaml:"title,omitempty"`
// MaxLevel 是标题目录的最大标题级别,0 表示 3,可取 1 到 6;图表目录必须省略或为 0。
MaxLevel int `json:"max_level,omitempty" yaml:"max_level,omitempty"`
// Source 选择 headings(默认)、figures 或 tables;图表目录仅收集带编号内容,max_level 仅用于标题目录。
Source string `json:"source,omitempty" yaml:"source,omitempty"`
}
FlowTOC 配置标题、图或表目录,默认标题目录的最大标题级别为 3。
type FlowTable ¶ added in v0.1.6
type FlowTable struct {
// SplitRows 按完整文字行跨页或跨栏拆分普通及 ColSpan 单元格;正文 RowSpan 不支持。
SplitRows bool `json:"split_rows,omitempty" yaml:"split_rows,omitempty"`
// Header 是可选表头。
Header []string `json:"header,omitempty" yaml:"header,omitempty"`
// Rows 是等列数的数据行。
Rows [][]string `json:"rows,omitempty" yaml:"rows,omitempty"`
// ColumnWidths 是毫米单位的列宽,省略时均分版心。
ColumnWidths []float64 `json:"column_widths,omitempty" yaml:"column_widths,omitempty"`
// Grid 是支持合并、样式与链接的单元格网格,与 header/rows 互斥;被合并占据的位置无需占位。
Grid [][]FlowTableCell `json:"grid,omitempty" yaml:"grid,omitempty"`
// HeaderRows 是 grid 开头在续页重复的行数,合并不能跨越表头与正文边界。
HeaderRows int `json:"header_rows,omitempty" yaml:"header_rows,omitempty"`
// Columns 配置按内容测量的自动列宽,与 column_widths 互斥;每项对应一列。
Columns []FlowTableColumn `json:"columns,omitempty" yaml:"columns,omitempty"`
// CellStyle 设置全表单元格默认外观,单元格 appearance 可以覆盖。
CellStyle *FlowCellStyle `json:"cell_style,omitempty" yaml:"cell_style,omitempty"`
// StripeFill 设置正文从第二行开始的隔行底色,跨页保持行序。
StripeFill *Color `json:"stripe_fill,omitempty" yaml:"stripe_fill,omitempty"`
// Caption 是表格上方的题注。
Caption string `json:"caption,omitempty" yaml:"caption,omitempty"`
// Numbered 为表题添加连续编号,图片与表格分别计数。
Numbered bool `json:"numbered,omitempty" yaml:"numbered,omitempty"`
// CaptionPrefix 是编号前缀,缺省 Table;需要 numbered。
CaptionPrefix string `json:"caption_prefix,omitempty" yaml:"caption_prefix,omitempty"`
// RepeatCaption 在续页表头上方重复题注,题注与首个行组同页。
RepeatCaption bool `json:"repeat_caption,omitempty" yaml:"repeat_caption,omitempty"`
// ContinuationSuffix 是续表题后缀,缺省 (continued)。
ContinuationSuffix string `json:"continuation_suffix,omitempty" yaml:"continuation_suffix,omitempty"`
}
FlowTable 定义表格,按完整行组分页,续页重复表头。
type FlowTableBorder ¶ added in v0.1.6
type FlowTableBorder struct {
// Width 是边框宽度,零表示隐藏。
Width float64 `json:"width" yaml:"width"`
// Color 是边框颜色,缺省继承主题边框颜色。
Color *Color `json:"color,omitempty" yaml:"color,omitempty"`
}
FlowTableBorder 定义毫米单位的实色边框。
type FlowTableCell ¶ added in v0.1.6
type FlowTableCell struct {
// Text 是纯文本,与 runs 互斥。
Text string `json:"text,omitempty" yaml:"text,omitempty"`
// Runs 是带字体、字重和链接的文字片段,与 text 互斥。
Runs []FlowRun `json:"runs,omitempty" yaml:"runs,omitempty"`
// ColSpan 是跨列数量,零值表示 1。
ColSpan int `json:"col_span,omitempty" yaml:"col_span,omitempty"`
// RowSpan 是跨行数量,零值表示 1。
RowSpan int `json:"row_span,omitempty" yaml:"row_span,omitempty"`
// Style 覆盖单元格文字样式,段间距位于文字上下方。
Style *FlowStyle `json:"style,omitempty" yaml:"style,omitempty"`
// Appearance 覆盖表格默认单元格外观。
Appearance *FlowCellStyle `json:"appearance,omitempty" yaml:"appearance,omitempty"`
}
FlowTableCell 定义按空闲列依次放置的合并单元格。
type FlowTableColumn ¶ added in v0.1.6
type FlowTableColumn struct {
// Width 为固定列宽,零表示按内容分配。
Width float64 `json:"width,omitempty" yaml:"width,omitempty"`
// MinWidth 是包含内边距的最小列宽。
MinWidth float64 `json:"min_width,omitempty" yaml:"min_width,omitempty"`
// MaxWidth 是包含内边距的最大列宽,零表示不限制。
MaxWidth float64 `json:"max_width,omitempty" yaml:"max_width,omitempty"`
// Weight 是自动列剩余宽度的比例,零表示 1。
Weight float64 `json:"weight,omitempty" yaml:"weight,omitempty"`
// NoWrap 禁止自动换行,保留显式换行;不够宽时返回错误。
NoWrap bool `json:"no_wrap,omitempty" yaml:"no_wrap,omitempty"`
// Align 是 left、center、right 或 justify,可由单元格 style 覆盖。
Align string `json:"align,omitempty" yaml:"align,omitempty"`
}
FlowTableColumn 定义毫米单位的列宽约束和内容换行行为。
type Font ¶
type Font struct {
// Name 指定文档内唯一的字体资源引用名,与文字的 font 字段对应。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// FontName 指定 OFD 中的实际字型名;省略时普通创建使用 name,flow 从嵌入字体自动补全。
FontName string `json:"font_name,omitempty" yaml:"font_name,omitempty"`
// FamilyName 指定字体族名称。
FamilyName string `json:"family_name,omitempty" yaml:"family_name,omitempty" toml:"family_name,omitempty"`
// Charset 指定字体字符集。
Charset string `json:"charset,omitempty" yaml:"charset,omitempty" toml:"charset,omitempty"`
// Format 指定字体文件格式。
Format string `json:"format,omitempty" yaml:"format,omitempty" toml:"format,omitempty"`
// File 指定字体文件路径。
File string `json:"file,omitempty" yaml:"file,omitempty" toml:"file,omitempty"`
// DataBase64 提供 Base64 编码的字体数据。
DataBase64 string `json:"data_base64,omitempty" yaml:"data_base64,omitempty" toml:"data_base64,omitempty"`
// Italic 指示字体是否为斜体。
Italic bool `json:"italic,omitempty" yaml:"italic,omitempty" toml:"italic,omitempty"`
// Bold 指示字体是否为粗体。
Bold bool `json:"bold,omitempty" yaml:"bold,omitempty" toml:"bold,omitempty"`
// Serif 指示字体是否为衬线字体。
Serif bool `json:"serif,omitempty" yaml:"serif,omitempty" toml:"serif,omitempty"`
// FixedWidth 指示字体是否为等宽字体。
FixedWidth bool `json:"fixed_width,omitempty" yaml:"fixed_width,omitempty" toml:"fixed_width,omitempty"`
}
Font 描述文档使用的字体资源。
type GotoAAction ¶
type GotoAAction struct {
// AttachID 指定跳转目标附件标识。
AttachID string `json:"attach_id,omitempty" yaml:"attach_id,omitempty" toml:"attach_id,omitempty"`
// NewWindow 指示是否在新窗口打开附件。
NewWindow *bool `json:"new_window,omitempty" yaml:"new_window,omitempty" toml:"new_window,omitempty"`
}
GotoAAction 描述跳转到附件的动作。
type GotoAction ¶
type GotoAction struct {
// Page 指定跳转目标页码。
Page int `json:"page,omitempty" yaml:"page,omitempty" toml:"page,omitempty"`
// Type 指定跳转目标类型。
Type string `json:"type,omitempty" yaml:"type,omitempty" toml:"type,omitempty"`
// Bookmark 指定跳转目标书签名称。
Bookmark string `json:"bookmark,omitempty" yaml:"bookmark,omitempty" toml:"bookmark,omitempty"`
// Left 指定目标视图左边界。
Left *float64 `json:"left,omitempty" yaml:"left,omitempty" toml:"left,omitempty"`
// Top 指定目标视图上边界。
Top *float64 `json:"top,omitempty" yaml:"top,omitempty" toml:"top,omitempty"`
// Right 指定目标视图右边界。
Right *float64 `json:"right,omitempty" yaml:"right,omitempty" toml:"right,omitempty"`
// Bottom 指定目标视图下边界。
Bottom *float64 `json:"bottom,omitempty" yaml:"bottom,omitempty" toml:"bottom,omitempty"`
// Zoom 指定目标视图缩放比例。
Zoom *float64 `json:"zoom,omitempty" yaml:"zoom,omitempty" toml:"zoom,omitempty"`
}
GotoAction 描述跳转到页面、书签或页面位置的动作。
type Gouraud ¶
type Gouraud struct {
// Extend 指定渐变边界的延伸方式。
Extend int `json:"extend,omitempty" yaml:"extend,omitempty" toml:"extend,omitempty"`
// Points 定义三角网格顶点。
Points []GouraudPoint `json:"points,omitempty" yaml:"points,omitempty" toml:"points,omitempty"`
// BackColor 指定网格背景颜色。
BackColor *Color `json:"back_color,omitempty" yaml:"back_color,omitempty" toml:"back_color,omitempty"`
}
Gouraud 描述 Gouraud 三角网格渐变。
type GouraudPoint ¶
type GouraudPoint struct {
// X 指定顶点横坐标。
X float64 `json:"x,omitempty" yaml:"x,omitempty" toml:"x,omitempty"`
// Y 指定顶点纵坐标。
Y float64 `json:"y,omitempty" yaml:"y,omitempty" toml:"y,omitempty"`
// EdgeFlag 指定顶点边标志。
EdgeFlag int `json:"edge_flag,omitempty" yaml:"edge_flag,omitempty" toml:"edge_flag,omitempty"`
// Color 指定顶点颜色。
Color Color `json:"color,omitempty" yaml:"color,omitempty" toml:"color,omitempty"`
}
GouraudPoint 描述 Gouraud 渐变网格中的顶点。
type Image ¶
type Image struct {
// ID 标识图像资源。
ID uint64 `json:"id,omitempty" yaml:"id,omitempty" toml:"id,omitempty"`
// Format 指定图像格式。
Format string `json:"format,omitempty" yaml:"format,omitempty" toml:"format,omitempty"`
// Name 指定图像名称。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// File 指定图像文件路径。
File string `json:"file,omitempty" yaml:"file,omitempty" toml:"file,omitempty"`
// DataBase64 提供 Base64 编码的图像数据。
DataBase64 string `json:"data_base64,omitempty" yaml:"data_base64,omitempty" toml:"data_base64,omitempty"`
}
Image 描述文档中的图像资源。
type ImageBorder ¶
type ImageBorder struct {
// LineWidth 指定图像边框线宽。
LineWidth float64 `json:"line_width,omitempty" yaml:"line_width,omitempty" toml:"line_width,omitempty"`
// HorizontalRadius 指定边框水平圆角半径。
HorizontalRadius float64 `json:"horizontal_radius,omitempty" yaml:"horizontal_radius,omitempty" toml:"horizontal_radius,omitempty"`
// VerticalRadius 指定边框垂直圆角半径。
VerticalRadius float64 `json:"vertical_radius,omitempty" yaml:"vertical_radius,omitempty" toml:"vertical_radius,omitempty"`
// DashOffset 指定边框虚线起始偏移量。
DashOffset float64 `json:"dash_offset,omitempty" yaml:"dash_offset,omitempty" toml:"dash_offset,omitempty"`
// DashPattern 指定边框虚线长度模式。
DashPattern []float64 `json:"dash_pattern,omitempty" yaml:"dash_pattern,omitempty" toml:"dash_pattern,omitempty"`
// Color 指定边框颜色。
Color *Color `json:"color,omitempty" yaml:"color,omitempty" toml:"color,omitempty"`
}
ImageBorder 描述图像边框的绘制样式。
type Item ¶
type Item struct {
// Bind 定义 text/image 图元的数据绑定,仅在模板渲染时展开。
Bind *Binding `json:"bind,omitempty" yaml:"bind,omitempty"`
// Type 指定图元类型。
Type string `json:"type,omitempty" yaml:"type,omitempty" toml:"type,omitempty"`
// X 指定图元左上角横坐标。
X float64 `json:"x,omitempty" yaml:"x,omitempty" toml:"x,omitempty"`
// Y 指定图元左上角纵坐标。
Y float64 `json:"y,omitempty" yaml:"y,omitempty" toml:"y,omitempty"`
// Width 指定图元宽度。
Width float64 `json:"width,omitempty" yaml:"width,omitempty" toml:"width,omitempty"`
// Height 指定图元高度。
Height float64 `json:"height,omitempty" yaml:"height,omitempty" toml:"height,omitempty"`
// Value 指定图元文本或其他值。
Value string `json:"value,omitempty" yaml:"value,omitempty" toml:"value,omitempty"`
// Font 指定文本图元使用的字体名称。
Font string `json:"font,omitempty" yaml:"font,omitempty" toml:"font,omitempty"`
// Size 指定文本字号。
Size float64 `json:"size,omitempty" yaml:"size,omitempty" toml:"size,omitempty"`
// Data 指定图元数据或文件路径。
Data string `json:"data,omitempty" yaml:"data,omitempty" toml:"data,omitempty"`
// DataBase64 提供 Base64 编码的图元数据。
DataBase64 string `json:"data_base64,omitempty" yaml:"data_base64,omitempty" toml:"data_base64,omitempty"`
// Format 指定图元数据格式。
Format string `json:"format,omitempty" yaml:"format,omitempty" toml:"format,omitempty"`
// Name 指定图元名称。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// Visible 指示图元是否可见。
Visible *bool `json:"visible,omitempty" yaml:"visible,omitempty" toml:"visible,omitempty"`
// ResourceID 指定图元引用的资源编号。
ResourceID uint64 `json:"resource_id,omitempty" yaml:"resource_id,omitempty" toml:"resource_id,omitempty"`
// Stroke 指示是否绘制轮廓线。
Stroke bool `json:"stroke,omitempty" yaml:"stroke,omitempty" toml:"stroke,omitempty"`
// Fill 指示是否填充图元。
Fill *bool `json:"fill,omitempty" yaml:"fill,omitempty" toml:"fill,omitempty"`
// StrokeSet 指示是否显式设置描边属性。
StrokeSet *bool `json:"stroke_set,omitempty" yaml:"stroke_set,omitempty" toml:"stroke_set,omitempty"`
// Rule 指定填充规则。
Rule string `json:"rule,omitempty" yaml:"rule,omitempty" toml:"rule,omitempty"`
// LineWidth 指定描边线宽。
LineWidth float64 `json:"line_width,omitempty" yaml:"line_width,omitempty" toml:"line_width,omitempty"`
// Cap 指定描边端点样式。
Cap string `json:"cap,omitempty" yaml:"cap,omitempty" toml:"cap,omitempty"`
// Join 指定描边连接样式。
Join string `json:"join,omitempty" yaml:"join,omitempty" toml:"join,omitempty"`
// MiterLimit 指定斜接长度限制。
MiterLimit float64 `json:"miter_limit,omitempty" yaml:"miter_limit,omitempty" toml:"miter_limit,omitempty"`
// DashOffset 指定虚线起始偏移量。
DashOffset float64 `json:"dash_offset,omitempty" yaml:"dash_offset,omitempty" toml:"dash_offset,omitempty"`
// DashPattern 指定虚线长度模式。
DashPattern []float64 `json:"dash_pattern,omitempty" yaml:"dash_pattern,omitempty" toml:"dash_pattern,omitempty"`
// Alpha 指定图元透明度。
Alpha *uint8 `json:"alpha,omitempty" yaml:"alpha,omitempty" toml:"alpha,omitempty"`
// DrawParam 指定图元使用的绘制参数名称。
DrawParam string `json:"draw_param,omitempty" yaml:"draw_param,omitempty" toml:"draw_param,omitempty"`
// CTM 指定图元的坐标变换矩阵。
CTM []float64 `json:"ctm,omitempty" yaml:"ctm,omitempty" toml:"ctm,omitempty"`
// FillColor 指定填充颜色。
FillColor *Color `json:"fill_color,omitempty" yaml:"fill_color,omitempty" toml:"fill_color,omitempty"`
// StrokeColor 指定描边颜色。
StrokeColor *Color `json:"stroke_color,omitempty" yaml:"stroke_color,omitempty" toml:"stroke_color,omitempty"`
// TextCodes 定义文本代码及其定位信息。
TextCodes []TextCode `json:"text_codes,omitempty" yaml:"text_codes,omitempty" toml:"text_codes,omitempty"`
// CGTransforms 定义文本代码到字形的映射。
CGTransforms []CGTransform `json:"cg_transforms,omitempty" yaml:"cg_transforms,omitempty" toml:"cg_transforms,omitempty"`
// Actions 定义图元触发的动作。
Actions []Action `json:"actions,omitempty" yaml:"actions,omitempty" toml:"actions,omitempty"`
// Items 定义复合或页面块图元的子图元。
Items []Item `json:"items,omitempty" yaml:"items,omitempty" toml:"items,omitempty"`
// HScale 指定文本水平方向缩放比例。
HScale float64 `json:"h_scale,omitempty" yaml:"h_scale,omitempty" toml:"h_scale,omitempty"`
// ReadDirection 指定文本阅读方向。
ReadDirection int `json:"read_direction,omitempty" yaml:"read_direction,omitempty" toml:"read_direction,omitempty"`
// CharDirection 指定字符排列方向。
CharDirection int `json:"char_direction,omitempty" yaml:"char_direction,omitempty" toml:"char_direction,omitempty"`
// Weight 指定文本字重。
Weight int `json:"weight,omitempty" yaml:"weight,omitempty" toml:"weight,omitempty"`
// Italic 指示文本是否为斜体。
Italic bool `json:"italic,omitempty" yaml:"italic,omitempty" toml:"italic,omitempty"`
// Clips 定义图元裁剪区域。
Clips []Clip `json:"clips,omitempty" yaml:"clips,omitempty" toml:"clips,omitempty"`
// Substitution 指定图像替代资源编号。
Substitution uint64 `json:"substitution,omitempty" yaml:"substitution,omitempty" toml:"substitution,omitempty"`
// ImageMask 指定图像掩码资源编号。
ImageMask uint64 `json:"image_mask,omitempty" yaml:"image_mask,omitempty" toml:"image_mask,omitempty"`
// Border 定义图像边框样式。
Border *ImageBorder `json:"border,omitempty" yaml:"border,omitempty" toml:"border,omitempty"`
// Rows 定义表格行(仅当 type 为 "table" 时有效)。
Rows []TableRow `json:"rows,omitempty" yaml:"rows,omitempty" toml:"rows,omitempty"`
// ColumnWidths 定义各列宽度(仅当 type 为 "table" 时有效)。
ColumnWidths []float64 `json:"column_widths,omitempty" yaml:"column_widths,omitempty" toml:"column_widths,omitempty"`
// HeaderRows 定义表头行数(仅当 type 为 "table" 时有效)。
HeaderRows int `json:"header_rows,omitempty" yaml:"header_rows,omitempty" toml:"header_rows,omitempty"`
// Style 定义表格样式(仅当 type 为 "table" 时有效)。
Style *TableStyle `json:"style,omitempty" yaml:"style,omitempty" toml:"style,omitempty"`
// Caption 定义表题文字(仅当 type 为 "table" 时有效)。
Caption string `json:"caption,omitempty" yaml:"caption,omitempty" toml:"caption,omitempty"`
// CaptionStyle 定义表题样式(仅当 type 为 "table" 时有效)。
CaptionStyle *CaptionStyle `json:"caption_style,omitempty" yaml:"caption_style,omitempty" toml:"caption_style,omitempty"`
// ContinuationCaption 定义续表题文字(仅当 type 为 "table" 时有效)。
ContinuationCaption string `json:"continuation_caption,omitempty" yaml:"continuation_caption,omitempty" toml:"continuation_caption,omitempty"`
// ContinuationCaptionStyle 定义续表题样式(仅当 type 为 "table" 时有效)。
ContinuationCaptionStyle *CaptionStyle `` /* 131-byte string literal not displayed */
// Align 指定图片与说明文字共用的水平对齐(仅当 type 为 "figure" 时有效)。
Align string `json:"align,omitempty" yaml:"align,omitempty" toml:"align,omitempty"`
// ImageWidth 定义图片宽度(仅当 type 为 "figure" 时有效)。
ImageWidth float64 `json:"image_width,omitempty" yaml:"image_width,omitempty" toml:"image_width,omitempty"`
// ImageFillWidth 指示 image_width 是否按图块宽度的比例解释(仅当 type 为 "figure" 时有效)。
ImageFillWidth bool `json:"image_fill_width,omitempty" yaml:"image_fill_width,omitempty" toml:"image_fill_width,omitempty"`
// ImageHeight 定义图片高度(仅当 type 为 "figure" 时有效)。
ImageHeight float64 `json:"image_height,omitempty" yaml:"image_height,omitempty" toml:"image_height,omitempty"`
// Fit 指定图片在给定尺寸内的适配方式:contain 保持比例,stretch 拉伸(仅当 type 为 "figure" 时有效)。
Fit string `json:"fit,omitempty" yaml:"fit,omitempty" toml:"fit,omitempty"`
}
Item 描述页面、模板或复合图形中的图元。
type LaGouraud ¶
type LaGouraud struct {
// VerticesPerRow 指定每行顶点数。
VerticesPerRow int `json:"vertices_per_row,omitempty" yaml:"vertices_per_row,omitempty" toml:"vertices_per_row,omitempty"`
// Extend 指定渐变边界的延伸方式。
Extend int `json:"extend,omitempty" yaml:"extend,omitempty" toml:"extend,omitempty"`
// Points 定义四边形网格顶点。
Points []LaGouraudPoint `json:"points,omitempty" yaml:"points,omitempty" toml:"points,omitempty"`
// BackColor 指定网格背景颜色。
BackColor *Color `json:"back_color,omitempty" yaml:"back_color,omitempty" toml:"back_color,omitempty"`
}
LaGouraud 描述 LaGouraud 四边形网格渐变。
type LaGouraudPoint ¶
type LaGouraudPoint struct {
// X 指定顶点横坐标。
X float64 `json:"x,omitempty" yaml:"x,omitempty" toml:"x,omitempty"`
// Y 指定顶点纵坐标。
Y float64 `json:"y,omitempty" yaml:"y,omitempty" toml:"y,omitempty"`
// Color 指定顶点颜色。
Color Color `json:"color,omitempty" yaml:"color,omitempty" toml:"color,omitempty"`
}
LaGouraudPoint 描述 LaGouraud 渐变网格中的顶点。
type Layer ¶
type Layer struct {
// Type 指定图层类型。
Type string `json:"type,omitempty" yaml:"type,omitempty" toml:"type,omitempty"`
// DrawParam 指定图层使用的绘制参数名称。
DrawParam string `json:"draw_param,omitempty" yaml:"draw_param,omitempty" toml:"draw_param,omitempty"`
// Items 定义图层中的图元。
Items []Item `json:"items,omitempty" yaml:"items,omitempty" toml:"items,omitempty"`
}
Layer 描述页面或模板中的图层。
type Manifest ¶
type Manifest struct {
// Version 指定 manifest 格式版本。
Version int `json:"version,omitempty" yaml:"version,omitempty" toml:"version,omitempty"`
// Document 定义文档主体及其元数据。
Document Document `json:"document" yaml:"document,omitempty" toml:"document,omitempty"`
// Resources 汇总文档级资源。
Resources Resources `json:"resources" yaml:"resources,omitempty" toml:"resources,omitempty"`
// Templates 定义可供页面引用的模板页。
Templates []Template `json:"templates,omitempty" yaml:"templates,omitempty" toml:"templates,omitempty"`
// Pages 定义文档页面。
Pages []Page `json:"pages,omitempty" yaml:"pages,omitempty" toml:"pages,omitempty"`
// Flow 按顺序排版内容,自动生成标准 OFD 页面;与 pages 互斥。
Flow *Flow `json:"flow,omitempty" yaml:"flow,omitempty"`
}
Manifest 是 ofd-creator 支持的声明式输入文件。
func (Manifest) BuildWithOptions ¶ added in v0.1.3
func (Manifest) RenderTemplate ¶ added in v0.1.6
func (m Manifest) RenderTemplate(data io.Reader, baseDir, assetRoot string, opts TemplateOptions) (creator.Document, error)
RenderTemplate 在清单副本中绑定数据并展开页面,再使用普通创建流程构建文档。 原清单和数据不被修改,同一模板可以并发用于不同数据。
type Media ¶
type Media struct {
// ID 标识媒体资源。
ID uint64 `json:"id,omitempty" yaml:"id,omitempty" toml:"id,omitempty"`
// Type 指定媒体类型。
Type string `json:"type,omitempty" yaml:"type,omitempty" toml:"type,omitempty"`
// Format 指定媒体格式。
Format string `json:"format,omitempty" yaml:"format,omitempty" toml:"format,omitempty"`
// Name 指定媒体名称。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// File 指定媒体文件路径。
File string `json:"file,omitempty" yaml:"file,omitempty" toml:"file,omitempty"`
// DataBase64 提供 Base64 编码的媒体数据。
DataBase64 string `json:"data_base64,omitempty" yaml:"data_base64,omitempty" toml:"data_base64,omitempty"`
}
Media 描述文档中的媒体资源。
type MovieAction ¶
type MovieAction struct {
// ResourceID 指定媒体资源编号。
ResourceID uint64 `json:"resource_id,omitempty" yaml:"resource_id,omitempty" toml:"resource_id,omitempty"`
// Operator 指定媒体操作类型。
Operator string `json:"operator,omitempty" yaml:"operator,omitempty" toml:"operator,omitempty"`
}
MovieAction 描述播放媒体资源的动作。
type Outline ¶
type Outline struct {
// Title 指定大纲节点标题。
Title string `json:"title,omitempty" yaml:"title,omitempty" toml:"title,omitempty"`
// Count 指定大纲节点包含的条目数。
Count *int `json:"count,omitempty" yaml:"count,omitempty" toml:"count,omitempty"`
// Expanded 指示大纲节点是否展开。
Expanded *bool `json:"expanded,omitempty" yaml:"expanded,omitempty" toml:"expanded,omitempty"`
// Actions 定义大纲节点动作。
Actions []Action `json:"actions,omitempty" yaml:"actions,omitempty" toml:"actions,omitempty"`
// Children 定义大纲子节点。
Children []Outline `json:"children,omitempty" yaml:"children,omitempty" toml:"children,omitempty"`
}
Outline 描述文档大纲节点及其子节点。
type Page ¶
type Page struct {
// Repeat 是模板渲染时从根数据读取的数组路径;每条记录生成一页,空数组不生成本页。
Repeat string `json:"repeat,omitempty" yaml:"repeat,omitempty"`
// Paginate 将当前记录中的明细数组按固定区域容量分页,可与 repeat 组合。
Paginate *DetailPagination `json:"paginate,omitempty" yaml:"paginate,omitempty"`
// Variants 为明细分页选择首页、续页、末页或单页附加版式;仅与 paginate 配合使用。
Variants *PageVariants `json:"variants,omitempty" yaml:"variants,omitempty"`
// Templates 指定页面引用的模板页。
Templates []TemplateRef `json:"templates,omitempty" yaml:"templates,omitempty" toml:"templates,omitempty"`
// Layers 定义页面图层。
Layers []Layer `json:"layers,omitempty" yaml:"layers,omitempty" toml:"layers,omitempty"`
// Items 定义页面图元。
Items []Item `json:"items,omitempty" yaml:"items,omitempty" toml:"items,omitempty"`
// Area 定义页面区域。
Area *PageArea `json:"area,omitempty" yaml:"area,omitempty" toml:"area,omitempty"`
// LayerType 指定页面图层类型。
LayerType string `json:"layer_type,omitempty" yaml:"layer_type,omitempty" toml:"layer_type,omitempty"`
// Actions 定义页面级动作。
Actions []Action `json:"actions,omitempty" yaml:"actions,omitempty" toml:"actions,omitempty"`
// Resources 定义页面级资源。
Resources []PageResource `json:"resources,omitempty" yaml:"resources,omitempty" toml:"resources,omitempty"`
}
Page 描述文档页面及其图层、图元和页面资源。
type PageArea ¶
type PageArea struct {
// PhysicalBox 定义页面物理区域。
PhysicalBox *Box `json:"physical_box,omitempty" yaml:"physical_box,omitempty" toml:"physical_box,omitempty"`
// ApplicationBox 定义页面应用区域。
ApplicationBox *Box `json:"application_box,omitempty" yaml:"application_box,omitempty" toml:"application_box,omitempty"`
// ContentBox 定义页面内容区域。
ContentBox *Box `json:"content_box,omitempty" yaml:"content_box,omitempty" toml:"content_box,omitempty"`
// BleedBox 定义页面出血区域。
BleedBox *Box `json:"bleed_box,omitempty" yaml:"bleed_box,omitempty" toml:"bleed_box,omitempty"`
}
PageArea 描述页面的物理、应用、内容和出血区域。
type PageImage ¶
type PageImage struct {
// ID 标识页面图像资源。
ID uint64 `json:"id,omitempty" yaml:"id,omitempty" toml:"id,omitempty"`
// Format 指定图像格式。
Format string `json:"format,omitempty" yaml:"format,omitempty" toml:"format,omitempty"`
// Name 指定图像名称。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// File 指定图像文件路径。
File string `json:"file,omitempty" yaml:"file,omitempty" toml:"file,omitempty"`
// DataBase64 提供 Base64 编码的图像数据。
DataBase64 string `json:"data_base64,omitempty" yaml:"data_base64,omitempty" toml:"data_base64,omitempty"`
}
PageImage 描述页面资源中的图像。
type PageResource ¶
type PageResource struct {
// File 指定页面资源文件路径。
File string `json:"file,omitempty" yaml:"file,omitempty" toml:"file,omitempty"`
// DataBase64 提供 Base64 编码的页面资源数据。
DataBase64 string `json:"data_base64,omitempty" yaml:"data_base64,omitempty" toml:"data_base64,omitempty"`
// Images 定义资源中的图像。
Images []PageImage `json:"images,omitempty" yaml:"images,omitempty" toml:"images,omitempty"`
// Files 定义页面资源包中的文件。
Files []ResourceFile `json:"files,omitempty" yaml:"files,omitempty" toml:"files,omitempty"`
}
PageResource 描述页面级资源文件或嵌入式图像。
type PageSize ¶
type PageSize struct {
// Name 指定预定义页面尺寸名称。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// Width 指定页面宽度。
Width float64 `json:"width,omitempty" yaml:"width,omitempty" toml:"width,omitempty"`
// Height 指定页面高度。
Height float64 `json:"height,omitempty" yaml:"height,omitempty" toml:"height,omitempty"`
}
PageSize 描述文档页面尺寸。
type PageVariant ¶ added in v0.1.6
type PageVariant struct {
// Templates 是该版式附加的 OFD 模板页引用。
Templates []TemplateRef `json:"templates,omitempty" yaml:"templates,omitempty"`
// Items 是该版式附加的固定图元,与 layers 互斥。
Items []Item `json:"items,omitempty" yaml:"items,omitempty"`
// Layers 是该版式附加的图层,与 items 互斥。
Layers []Layer `json:"layers,omitempty" yaml:"layers,omitempty"`
// DetailArea 覆盖明细区域的位置和高度;宽度必须等于公共明细区域宽度。
DetailArea *Box `json:"detail_area,omitempty" yaml:"detail_area,omitempty"`
}
PageVariant 追加到公共页面;不替换公共图元或模板引用。
type PageVariants ¶ added in v0.1.6
type PageVariants struct {
// First 用于多页单据的首页。
First *PageVariant `json:"first,omitempty" yaml:"first,omitempty"`
// Continuation 用于中间页,也作为未配置 last 时的末页版式。
Continuation *PageVariant `json:"continuation,omitempty" yaml:"continuation,omitempty"`
// Last 用于多页单据的末页。
Last *PageVariant `json:"last,omitempty" yaml:"last,omitempty"`
// Single 用于单页单据;省略时按 last、first 的顺序回退。
Single *PageVariant `json:"single,omitempty" yaml:"single,omitempty"`
}
PageVariants 定义明细分页的附加内容和明细区域。
type Pattern ¶
type Pattern struct {
// Width 指定图案单元宽度。
Width float64 `json:"width,omitempty" yaml:"width,omitempty" toml:"width,omitempty"`
// Height 指定图案单元高度。
Height float64 `json:"height,omitempty" yaml:"height,omitempty" toml:"height,omitempty"`
// XStep 指定图案在横向的重复步长。
XStep float64 `json:"x_step,omitempty" yaml:"x_step,omitempty" toml:"x_step,omitempty"`
// YStep 指定图案在纵向的重复步长。
YStep float64 `json:"y_step,omitempty" yaml:"y_step,omitempty" toml:"y_step,omitempty"`
// ReflectMethod 指定图案反射方式。
ReflectMethod string `json:"reflect_method,omitempty" yaml:"reflect_method,omitempty" toml:"reflect_method,omitempty"`
// RelativeTo 指定图案定位所依据的对象。
RelativeTo string `json:"relative_to,omitempty" yaml:"relative_to,omitempty" toml:"relative_to,omitempty"`
// CTM 指定图案的坐标变换矩阵。
CTM []float64 `json:"ctm,omitempty" yaml:"ctm,omitempty" toml:"ctm,omitempty"`
// Thumbnail 指定图案缩略图资源编号。
Thumbnail uint64 `json:"thumbnail,omitempty" yaml:"thumbnail,omitempty" toml:"thumbnail,omitempty"`
// Items 定义图案中的图元。
Items []Item `json:"items,omitempty" yaml:"items,omitempty" toml:"items,omitempty"`
// Layers 定义图案中的图层。
Layers []Layer `json:"layers,omitempty" yaml:"layers,omitempty" toml:"layers,omitempty"`
}
Pattern 描述图案填充及其内容。
type Permissions ¶
type Permissions struct {
// Edit 指示是否允许编辑文档。
Edit *bool `json:"edit,omitempty" yaml:"edit,omitempty" toml:"edit,omitempty"`
// Annot 指示是否允许添加或修改批注。
Annot *bool `json:"annot,omitempty" yaml:"annot,omitempty" toml:"annot,omitempty"`
// Export 指示是否允许导出文档。
Export *bool `json:"export,omitempty" yaml:"export,omitempty" toml:"export,omitempty"`
// Signature 指示是否允许签名。
Signature *bool `json:"signature,omitempty" yaml:"signature,omitempty" toml:"signature,omitempty"`
// Watermark 指示是否允许修改水印。
Watermark *bool `json:"watermark,omitempty" yaml:"watermark,omitempty" toml:"watermark,omitempty"`
// PrintScreen 指示是否允许屏幕截图。
PrintScreen *bool `json:"print_screen,omitempty" yaml:"print_screen,omitempty" toml:"print_screen,omitempty"`
// Print 定义打印权限和设置。
Print *PrintSettings `json:"print,omitempty" yaml:"print,omitempty" toml:"print,omitempty"`
// ValidPeriod 定义权限的有效时间范围。
ValidPeriod *ValidPeriod `json:"valid_period,omitempty" yaml:"valid_period,omitempty" toml:"valid_period,omitempty"`
}
Permissions 描述文档的访问和操作权限。
type Point ¶
type Point struct {
// X 指定横坐标。
X float64 `json:"x,omitempty" yaml:"x,omitempty" toml:"x,omitempty"`
// Y 指定纵坐标。
Y float64 `json:"y,omitempty" yaml:"y,omitempty" toml:"y,omitempty"`
}
Point 描述二维坐标点。
type Preferences ¶
type Preferences struct {
// PageMode 指定页面显示模式。
PageMode string `json:"page_mode,omitempty" yaml:"page_mode,omitempty" toml:"page_mode,omitempty"`
// PageLayout 指定页面布局方式。
PageLayout string `json:"page_layout,omitempty" yaml:"page_layout,omitempty" toml:"page_layout,omitempty"`
// TabDisplay 指定文档标签页显示方式。
TabDisplay string `json:"tab_display,omitempty" yaml:"tab_display,omitempty" toml:"tab_display,omitempty"`
// HideToolbar 指示是否隐藏工具栏。
HideToolbar *bool `json:"hide_toolbar,omitempty" yaml:"hide_toolbar,omitempty" toml:"hide_toolbar,omitempty"`
// HideMenubar 指示是否隐藏菜单栏。
HideMenubar *bool `json:"hide_menubar,omitempty" yaml:"hide_menubar,omitempty" toml:"hide_menubar,omitempty"`
// HideWindowUI 指示是否隐藏窗口界面元素。
HideWindowUI *bool `json:"hide_window_ui,omitempty" yaml:"hide_window_ui,omitempty" toml:"hide_window_ui,omitempty"`
// ZoomMode 指定缩放模式。
ZoomMode string `json:"zoom_mode,omitempty" yaml:"zoom_mode,omitempty" toml:"zoom_mode,omitempty"`
// Zoom 指定页面缩放比例。
Zoom *float64 `json:"zoom,omitempty" yaml:"zoom,omitempty" toml:"zoom,omitempty"`
}
Preferences 描述文档查看偏好设置。
type PrintSettings ¶
type PrintSettings struct {
// Printable 指示是否允许打印。
Printable bool `json:"printable,omitempty" yaml:"printable,omitempty" toml:"printable,omitempty"`
// Copies 指定允许或默认的打印份数。
Copies *int `json:"copies,omitempty" yaml:"copies,omitempty" toml:"copies,omitempty"`
}
PrintSettings 描述文档打印设置。
type PublicResource ¶
type PublicResource struct {
// Name 指定公共资源名称。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// File 指定公共资源文件路径。
File string `json:"file,omitempty" yaml:"file,omitempty" toml:"file,omitempty"`
// DataBase64 提供 Base64 编码的公共资源数据。
DataBase64 string `json:"data_base64,omitempty" yaml:"data_base64,omitempty" toml:"data_base64,omitempty"`
// Files 定义公共资源包中的文件。
Files []ResourceFile `json:"files,omitempty" yaml:"files,omitempty" toml:"files,omitempty"`
}
PublicResource 描述文档中的公共资源。
type RadialShading ¶
type RadialShading struct {
// MapType 指定渐变映射类型。
MapType string `json:"map_type,omitempty" yaml:"map_type,omitempty" toml:"map_type,omitempty"`
// MapUnit 指定渐变映射单位。
MapUnit float64 `json:"map_unit,omitempty" yaml:"map_unit,omitempty" toml:"map_unit,omitempty"`
// Eccentricity 指定径向渐变椭圆离心率。
Eccentricity float64 `json:"eccentricity,omitempty" yaml:"eccentricity,omitempty" toml:"eccentricity,omitempty"`
// Angle 指定径向渐变旋转角度。
Angle float64 `json:"angle,omitempty" yaml:"angle,omitempty" toml:"angle,omitempty"`
// StartPoint 指定渐变起点圆心。
StartPoint string `json:"start_point,omitempty" yaml:"start_point,omitempty" toml:"start_point,omitempty"`
// StartRadius 指定渐变起始半径。
StartRadius float64 `json:"start_radius,omitempty" yaml:"start_radius,omitempty" toml:"start_radius,omitempty"`
// EndPoint 指定渐变终点圆心。
EndPoint string `json:"end_point,omitempty" yaml:"end_point,omitempty" toml:"end_point,omitempty"`
// EndRadius 指定渐变结束半径。
EndRadius float64 `json:"end_radius,omitempty" yaml:"end_radius,omitempty" toml:"end_radius,omitempty"`
// Extend 指定渐变端点的延伸方式。
Extend int `json:"extend,omitempty" yaml:"extend,omitempty" toml:"extend,omitempty"`
// Segments 定义渐变颜色停止点。
Segments []ColorStop `json:"segments,omitempty" yaml:"segments,omitempty" toml:"segments,omitempty"`
}
RadialShading 描述径向渐变。
type RegionCommand ¶
type RegionCommand struct {
// Type 指定路径命令类型。
Type string `json:"type,omitempty" yaml:"type,omitempty" toml:"type,omitempty"`
// X 指定命令终点横坐标。
X float64 `json:"x,omitempty" yaml:"x,omitempty" toml:"x,omitempty"`
// Y 指定命令终点纵坐标。
Y float64 `json:"y,omitempty" yaml:"y,omitempty" toml:"y,omitempty"`
// ControlX 指定二次贝塞尔曲线控制点横坐标。
ControlX float64 `json:"control_x,omitempty" yaml:"control_x,omitempty" toml:"control_x,omitempty"`
// ControlY 指定二次贝塞尔曲线控制点纵坐标。
ControlY float64 `json:"control_y,omitempty" yaml:"control_y,omitempty" toml:"control_y,omitempty"`
// Control1X 指定三次贝塞尔曲线第一个控制点横坐标。
Control1X float64 `json:"control_1_x,omitempty" yaml:"control_1_x,omitempty" toml:"control_1_x,omitempty"`
// Control1Y 指定三次贝塞尔曲线第一个控制点纵坐标。
Control1Y float64 `json:"control_1_y,omitempty" yaml:"control_1_y,omitempty" toml:"control_1_y,omitempty"`
// Control2X 指定三次贝塞尔曲线第二个控制点横坐标。
Control2X float64 `json:"control_2_x,omitempty" yaml:"control_2_x,omitempty" toml:"control_2_x,omitempty"`
// Control2Y 指定三次贝塞尔曲线第二个控制点纵坐标。
Control2Y float64 `json:"control_2_y,omitempty" yaml:"control_2_y,omitempty" toml:"control_2_y,omitempty"`
// SweepDirection 指定椭圆弧的扫描方向。
SweepDirection bool `json:"sweep_direction,omitempty" yaml:"sweep_direction,omitempty" toml:"sweep_direction,omitempty"`
// LargeArc 指示椭圆弧是否取大弧段。
LargeArc bool `json:"large_arc,omitempty" yaml:"large_arc,omitempty" toml:"large_arc,omitempty"`
// RotationAngle 指定椭圆弧旋转角度。
RotationAngle float64 `json:"rotation_angle,omitempty" yaml:"rotation_angle,omitempty" toml:"rotation_angle,omitempty"`
// EllipseWidth 指定椭圆弧椭圆宽度。
EllipseWidth float64 `json:"ellipse_width,omitempty" yaml:"ellipse_width,omitempty" toml:"ellipse_width,omitempty"`
// EllipseHeight 指定椭圆弧椭圆高度。
EllipseHeight float64 `json:"ellipse_height,omitempty" yaml:"ellipse_height,omitempty" toml:"ellipse_height,omitempty"`
}
RegionCommand 描述动作区域路径中的绘制命令。
type ResourceFile ¶
type ResourceFile struct {
// Path 指定文件在资源包中的路径。
Path string `json:"path,omitempty" yaml:"path,omitempty" toml:"path,omitempty"`
// File 指定源文件路径。
File string `json:"file,omitempty" yaml:"file,omitempty" toml:"file,omitempty"`
// DataBase64 提供 Base64 编码的文件数据。
DataBase64 string `json:"data_base64,omitempty" yaml:"data_base64,omitempty" toml:"data_base64,omitempty"`
}
ResourceFile 描述资源包中的文件。
type Resources ¶
type Resources struct {
// Fonts 汇总字体资源。
Fonts []Font `json:"fonts,omitempty" yaml:"fonts,omitempty" toml:"fonts,omitempty"`
// Images 汇总图像资源。
Images []Image `json:"images,omitempty" yaml:"images,omitempty" toml:"images,omitempty"`
// Media 汇总媒体资源。
Media []Media `json:"media,omitempty" yaml:"media,omitempty" toml:"media,omitempty"`
// ColorSpaces 汇总颜色空间资源。
ColorSpaces []ColorSpace `json:"color_spaces,omitempty" yaml:"color_spaces,omitempty" toml:"color_spaces,omitempty"`
// DrawParams 汇总图形绘制参数。
DrawParams []DrawParam `json:"draw_params,omitempty" yaml:"draw_params,omitempty" toml:"draw_params,omitempty"`
// Composites 汇总复合图形单元资源。
Composites []Composite `json:"composites,omitempty" yaml:"composites,omitempty" toml:"composites,omitempty"`
// Public 汇总公共资源。
Public []PublicResource `json:"public,omitempty" yaml:"public,omitempty" toml:"public,omitempty"`
// CustomTags 汇总自定义标签资源。
CustomTags []CustomTag `json:"custom_tags,omitempty" yaml:"custom_tags,omitempty" toml:"custom_tags,omitempty"`
}
Resources 汇总文档级资源。
type Signature ¶
type Signature struct {
// ID 标识数字签名。
ID string `json:"id,omitempty" yaml:"id,omitempty" toml:"id,omitempty"`
// Type 指定签名类型。
Type string `json:"type,omitempty" yaml:"type,omitempty" toml:"type,omitempty"`
// ProviderName 指定签名提供方名称。
ProviderName string `json:"provider_name,omitempty" yaml:"provider_name,omitempty" toml:"provider_name,omitempty"`
// ProviderVersion 指定签名提供方版本。
ProviderVersion string `json:"provider_version,omitempty" yaml:"provider_version,omitempty" toml:"provider_version,omitempty"`
// Company 指定签名提供方公司。
Company string `json:"company,omitempty" yaml:"company,omitempty" toml:"company,omitempty"`
// Method 指定签名方法。
Method string `json:"method,omitempty" yaml:"method,omitempty" toml:"method,omitempty"`
// Date 记录签名时间。
Date string `json:"date,omitempty" yaml:"date,omitempty" toml:"date,omitempty"`
// CheckMethod 指定签名校验方法。
CheckMethod string `json:"check_method,omitempty" yaml:"check_method,omitempty" toml:"check_method,omitempty"`
// References 定义签名引用及其校验值。
References []SignatureReference `json:"references,omitempty" yaml:"references,omitempty" toml:"references,omitempty"`
// StampAnnots 定义签名盖章区域。
StampAnnots []SignatureStamp `json:"stamp_annots,omitempty" yaml:"stamp_annots,omitempty" toml:"stamp_annots,omitempty"`
// SealFile 指定印章文件路径。
SealFile string `json:"seal_file,omitempty" yaml:"seal_file,omitempty" toml:"seal_file,omitempty"`
// SealFileBase64 提供 Base64 编码的印章数据。
SealFileBase64 string `json:"seal_file_base64,omitempty" yaml:"seal_file_base64,omitempty" toml:"seal_file_base64,omitempty"`
// SealName 指定印章文件名称。
SealName string `json:"seal_name,omitempty" yaml:"seal_name,omitempty" toml:"seal_name,omitempty"`
// SignedValue 提供 Base64 编码的签名值。
SignedValue string `json:"signed_value,omitempty" yaml:"signed_value,omitempty" toml:"signed_value,omitempty"`
// SignedValueName 指定签名值文件名称。
SignedValueName string `json:"signed_value_name,omitempty" yaml:"signed_value_name,omitempty" toml:"signed_value_name,omitempty"`
}
Signature 描述文档数字签名。
type SignatureReference ¶
type SignatureReference struct {
// FileRef 指定签名引用的文件路径。
FileRef string `json:"file_ref,omitempty" yaml:"file_ref,omitempty" toml:"file_ref,omitempty"`
// CheckValue 提供 Base64 编码的文件校验值。
CheckValue string `json:"check_value,omitempty" yaml:"check_value,omitempty" toml:"check_value,omitempty"`
}
SignatureReference 描述数字签名引用的文件及校验值。
type SignatureStamp ¶
type SignatureStamp struct {
// ID 标识签名盖章区域。
ID string `json:"id,omitempty" yaml:"id,omitempty" toml:"id,omitempty"`
// Page 指定盖章所在页码。
Page int `json:"page,omitempty" yaml:"page,omitempty" toml:"page,omitempty"`
// Boundary 指定盖章区域边界。
Boundary Box `json:"boundary,omitempty" yaml:"boundary,omitempty" toml:"boundary,omitempty"`
// Clip 指定盖章区域裁剪框。
Clip *Box `json:"clip,omitempty" yaml:"clip,omitempty" toml:"clip,omitempty"`
}
SignatureStamp 描述数字签名在页面上的盖章区域。
type SoundAction ¶
type SoundAction struct {
// ResourceID 指定声音资源编号。
ResourceID uint64 `json:"resource_id,omitempty" yaml:"resource_id,omitempty" toml:"resource_id,omitempty"`
// Volume 指定播放音量。
Volume *int `json:"volume,omitempty" yaml:"volume,omitempty" toml:"volume,omitempty"`
// Repeat 指示是否循环播放。
Repeat *bool `json:"repeat,omitempty" yaml:"repeat,omitempty" toml:"repeat,omitempty"`
// Synchronous 指示是否同步播放。
Synchronous *bool `json:"synchronous,omitempty" yaml:"synchronous,omitempty" toml:"synchronous,omitempty"`
}
SoundAction 描述播放声音资源的动作。
type TableCell ¶ added in v0.1.5
type TableCell struct {
// Value 定义单元格文本内容。
Value string `json:"value,omitempty" yaml:"value,omitempty" toml:"value,omitempty"`
// Font 定义字体。
Font string `json:"font,omitempty" yaml:"font,omitempty" toml:"font,omitempty"`
// Size 定义字号。
Size float64 `json:"size,omitempty" yaml:"size,omitempty" toml:"size,omitempty"`
// Weight 定义字重。
Weight int `json:"weight,omitempty" yaml:"weight,omitempty" toml:"weight,omitempty"`
// Italic 指示是否斜体。
Italic bool `json:"italic,omitempty" yaml:"italic,omitempty" toml:"italic,omitempty"`
// Align 定义对齐方式(left/center/right)。
Align string `json:"align,omitempty" yaml:"align,omitempty" toml:"align,omitempty"`
// ColSpan 定义横向合并的列数。
ColSpan int `json:"col_span,omitempty" yaml:"col_span,omitempty" toml:"col_span,omitempty"`
// RowSpan 定义纵向合并的行数。
RowSpan int `json:"row_span,omitempty" yaml:"row_span,omitempty" toml:"row_span,omitempty"`
// FirstLineIndent 定义首行缩进。
FirstLineIndent float64 `json:"first_line_indent,omitempty" yaml:"first_line_indent,omitempty" toml:"first_line_indent,omitempty"`
// HangingIndent 定义续行缩进。
HangingIndent float64 `json:"hanging_indent,omitempty" yaml:"hanging_indent,omitempty" toml:"hanging_indent,omitempty"`
// Format 定义文本格式(text/markdown)。
Format string `json:"format,omitempty" yaml:"format,omitempty" toml:"format,omitempty"`
// FillColor 定义单元格背景色。
FillColor *Color `json:"fill_color,omitempty" yaml:"fill_color,omitempty" toml:"fill_color,omitempty"`
// Actions 定义单元格的点击动作,作用范围是整个单元格。
Actions []Action `json:"actions,omitempty" yaml:"actions,omitempty" toml:"actions,omitempty"`
}
TableCell 定义表格单元格。
type TableRow ¶ added in v0.1.5
type TableRow struct {
// Cells 定义该行包含的单元格。
Cells []TableCell `json:"cells,omitempty" yaml:"cells,omitempty" toml:"cells,omitempty"`
}
TableRow 定义表格行。
type TableStyle ¶ added in v0.1.5
type TableStyle struct {
// HorizontalLines 指示是否绘制横线。
HorizontalLines bool `json:"horizontal_lines,omitempty" yaml:"horizontal_lines,omitempty" toml:"horizontal_lines,omitempty"`
// VerticalLines 指示是否绘制竖线。
VerticalLines bool `json:"vertical_lines,omitempty" yaml:"vertical_lines,omitempty" toml:"vertical_lines,omitempty"`
// LineWidth 定义内部线宽。
LineWidth float64 `json:"line_width,omitempty" yaml:"line_width,omitempty" toml:"line_width,omitempty"`
// StrokeColor 定义边框颜色。
StrokeColor *Color `json:"stroke_color,omitempty" yaml:"stroke_color,omitempty" toml:"stroke_color,omitempty"`
// OuterLineWidth 定义外框线宽。
OuterLineWidth float64 `json:"outer_line_width,omitempty" yaml:"outer_line_width,omitempty" toml:"outer_line_width,omitempty"`
// HeaderLineWidth 定义表头分隔线宽。
HeaderLineWidth float64 `json:"header_line_width,omitempty" yaml:"header_line_width,omitempty" toml:"header_line_width,omitempty"`
// HeaderFillColor 定义表头背景色。
HeaderFillColor *Color `json:"header_fill_color,omitempty" yaml:"header_fill_color,omitempty" toml:"header_fill_color,omitempty"`
// HeaderFont 定义表头字体。
HeaderFont string `json:"header_font,omitempty" yaml:"header_font,omitempty" toml:"header_font,omitempty"`
// HeaderSize 定义表头字号。
HeaderSize float64 `json:"header_size,omitempty" yaml:"header_size,omitempty" toml:"header_size,omitempty"`
// HeaderWeight 定义表头字重。
HeaderWeight int `json:"header_weight,omitempty" yaml:"header_weight,omitempty" toml:"header_weight,omitempty"`
// StrikeColor 定义 Markdown 删除线的颜色;不设时与边框同色。
StrikeColor *Color `json:"strike_color,omitempty" yaml:"strike_color,omitempty" toml:"strike_color,omitempty"`
// LinkColor 定义 Markdown 行内链接的文字颜色;不设时用默认链接蓝。
LinkColor *Color `json:"link_color,omitempty" yaml:"link_color,omitempty" toml:"link_color,omitempty"`
// RuleColor 定义 Markdown 分隔线的颜色;不设时与边框同色。
RuleColor *Color `json:"rule_color,omitempty" yaml:"rule_color,omitempty" toml:"rule_color,omitempty"`
// CodeFont 定义 Markdown 行内代码使用的字体。
CodeFont string `json:"code_font,omitempty" yaml:"code_font,omitempty" toml:"code_font,omitempty"`
}
TableStyle 定义表格样式。
type Template ¶
type Template struct {
// ID 标识模板页。
ID uint64 `json:"id,omitempty" yaml:"id,omitempty" toml:"id,omitempty"`
// Name 指定模板页名称。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// ZOrder 指定模板页的层叠顺序。
ZOrder string `json:"z_order,omitempty" yaml:"z_order,omitempty" toml:"z_order,omitempty"`
// Layers 定义模板页图层。
Layers []Layer `json:"layers,omitempty" yaml:"layers,omitempty" toml:"layers,omitempty"`
// Items 定义模板页图元。
Items []Item `json:"items,omitempty" yaml:"items,omitempty" toml:"items,omitempty"`
// Area 定义模板页区域。
Area *PageArea `json:"area,omitempty" yaml:"area,omitempty" toml:"area,omitempty"`
}
Template 描述可供页面引用的模板页。
type TemplateOptions ¶ added in v0.1.6
type TemplateOptions struct {
BuildOptions
// MaxPages 限制最终页数,0 使用 10000,负数无效。
MaxPages int
}
TemplateOptions 控制固定版式模板的资源加载与页面展开。
type TemplateRef ¶
type TemplateRef struct {
// ID 指定所引用的模板页。
ID uint64 `json:"id,omitempty" yaml:"id,omitempty" toml:"id,omitempty"`
// ZOrder 指定模板引用的层叠顺序。
ZOrder string `json:"z_order,omitempty" yaml:"z_order,omitempty" toml:"z_order,omitempty"`
}
TemplateRef 描述页面对模板页的引用。
type TextCode ¶
type TextCode struct {
// Value 指定文本内容。
Value string `json:"value,omitempty" yaml:"value,omitempty" toml:"value,omitempty"`
// X 指定文本代码横坐标。
X *float64 `json:"x,omitempty" yaml:"x,omitempty" toml:"x,omitempty"`
// Y 指定文本代码纵坐标。
Y *float64 `json:"y,omitempty" yaml:"y,omitempty" toml:"y,omitempty"`
// DeltaX 指定连续字符的横向偏移量。
DeltaX []float64 `json:"delta_x,omitempty" yaml:"delta_x,omitempty" toml:"delta_x,omitempty"`
// DeltaY 指定连续字符的纵向偏移量。
DeltaY []float64 `json:"delta_y,omitempty" yaml:"delta_y,omitempty" toml:"delta_y,omitempty"`
}
TextCode 描述文本内容及其定位信息。
type TypeDoc ¶ added in v0.1.5
type TypeDoc struct {
// Name 是 Go 结构体名。
Name string
// Path 是从 manifest 根首次到达该结构体的路径,根结构体为空串。
Path string
// Doc 是结构体自身的说明。
Doc string
// Fields 是该结构体的直接字段。
Fields []FieldDoc
}
TypeDoc 是 manifest 里一个结构体的字段说明。
type URIAction ¶
type URIAction struct {
// URI 指定目标 URI。
URI string `json:"uri,omitempty" yaml:"uri,omitempty" toml:"uri,omitempty"`
// Base 指定 URI 基础地址。
Base string `json:"base,omitempty" yaml:"base,omitempty" toml:"base,omitempty"`
// Target 指定 URI 打开目标。
Target string `json:"target,omitempty" yaml:"target,omitempty" toml:"target,omitempty"`
}
URIAction 描述打开或跳转到 URI 的动作。
type ValidPeriod ¶
type ValidPeriod struct {
// Start 指定权限生效时间。
Start string `json:"start,omitempty" yaml:"start,omitempty" toml:"start,omitempty"`
// End 指定权限失效时间。
End string `json:"end,omitempty" yaml:"end,omitempty" toml:"end,omitempty"`
}
ValidPeriod 描述权限的有效时间范围。
type Version ¶
type Version struct {
// ID 标识文档版本。
ID string `json:"id,omitempty" yaml:"id,omitempty" toml:"id,omitempty"`
// Index 指定版本序号。
Index int `json:"index,omitempty" yaml:"index,omitempty" toml:"index,omitempty"`
// Current 指示是否为当前版本。
Current bool `json:"current,omitempty" yaml:"current,omitempty" toml:"current,omitempty"`
// Version 指定版本号。
Version string `json:"version" yaml:"version" toml:"version"`
// Name 指定版本名称。
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`
// CreationDate 记录版本创建时间。
CreationDate string `json:"creation_date,omitempty" yaml:"creation_date,omitempty" toml:"creation_date,omitempty"`
// DocRoot 指定版本文档根文件路径。
DocRoot string `json:"doc_root,omitempty" yaml:"doc_root,omitempty" toml:"doc_root,omitempty"`
// DocRootBase64 提供 Base64 编码的版本文档根数据。
DocRootBase64 string `json:"doc_root_base64,omitempty" yaml:"doc_root_base64,omitempty" toml:"doc_root_base64,omitempty"`
// DocRootName 指定版本文档根文件名称。
DocRootName string `json:"doc_root_name,omitempty" yaml:"doc_root_name,omitempty" toml:"doc_root_name,omitempty"`
// Files 定义版本包含的文件。
Files []VersionFile `json:"files,omitempty" yaml:"files,omitempty" toml:"files,omitempty"`
}
Version 描述文档的一个版本。
type VersionFile ¶
type VersionFile struct {
// ID 标识版本文件。
ID string `json:"id,omitempty" yaml:"id,omitempty" toml:"id,omitempty"`
// Path 指定文件在版本中的路径。
Path string `json:"path,omitempty" yaml:"path,omitempty" toml:"path,omitempty"`
}
VersionFile 描述文档版本中的文件。
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package export 将 OFD 文档导出为 ofd-creator 可读取的 manifest。
|
Package export 将 OFD 文档导出为 ofd-creator 可读取的 manifest。 |
|
Package fielddocs 从 manifest 的 schema 源码中提取字段说明,供 ofd-creator schema 生成字段参考文档,也供生成器产出 fielddocs.go。
|
Package fielddocs 从 manifest 的 schema 源码中提取字段说明,供 ofd-creator schema 生成字段参考文档,也供生成器产出 fielddocs.go。 |
|
cmd/gen-fielddocs
command
gen-fielddocs 读取 internal/manifest/manifest.go 的字段注释,生成 internal/manifest/fielddocs.go。
|
gen-fielddocs 读取 internal/manifest/manifest.go 的字段注释,生成 internal/manifest/fielddocs.go。 |