spec

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package spec 定义 OFD 规范的固定常量,供解析、创建、校验等各包共享,也供 外部使用者构造和校验 OFD 文档时引用,避免在各处硬编码字符串。

Index

Constants

View Source
const (
	// LayerBody 普通正文图层。
	LayerBody = "Body"
	// LayerBackground 背景图层。
	LayerBackground = "Background"
	// LayerForeground 前景图层。
	LayerForeground = "Foreground"
	// LayerCustom 自定义图层。
	LayerCustom = "Custom"
)

图层类型(Layer/@Type)。创建、文字提取和渲染都要判断图层是否为背景层, 取值集中在这里避免各包各写一份字面量。

View Source
const (
	// ZOrderBackground 模板页绘制在页面内容之后(背景层)。
	ZOrderBackground = "Background"
	// ZOrderForeground 模板页绘制在页面内容之前(前景层)。
	ZOrderForeground = "Foreground"
)

模板页叠放顺序(TemplatePage/@ZOrder、Template/@ZOrder)。

View Source
const (
	// SigTypeSeal 签章。
	SigTypeSeal = "Seal"
	// SigTypeSign 签名。
	SigTypeSign = "Sign"
)

签名类型(Signature/@Type)。

View Source
const (
	// PageModeNone 使用默认页面显示模式。
	PageModeNone = "None"
	// PageModeFullScreen 以全屏模式显示文档。
	PageModeFullScreen = "FullScreen"
	// PageModeUseOutlines 显示文档大纲面板。
	PageModeUseOutlines = "UseOutlines"
	// PageModeUseThumbs 显示页面缩略图面板。
	PageModeUseThumbs = "UseThumbs"
	// PageModeUseCustomTags 显示自定义标签面板。
	PageModeUseCustomTags = "UseCustomTags"
	// PageModeUseLayers 显示图层面板。
	PageModeUseLayers = "UseLayers"
	// PageModeUseAttatchs 显示附件面板。拼写沿用 OFD 规范原文(Attatchs)。
	PageModeUseAttatchs = "UseAttatchs"
	// PageModeUseBookmarks 显示书签面板。
	PageModeUseBookmarks = "UseBookmarks"

	// PageLayoutOnePage 单页显示。
	PageLayoutOnePage = "OnePage"
	// PageLayoutOneColumn 单列连续显示。
	PageLayoutOneColumn = "OneColumn"
	// PageLayoutTwoPageL 双页显示,页面从左向右排列。
	PageLayoutTwoPageL = "TwoPageL"
	// PageLayoutTwoColumnL 双列连续显示,页面从左向右排列。
	PageLayoutTwoColumnL = "TwoColumnL"
	// PageLayoutTwoPageR 双页显示,页面从右向左排列。
	PageLayoutTwoPageR = "TwoPageR"
	// PageLayoutTwoColumnR 双列连续显示,页面从右向左排列。
	PageLayoutTwoColumnR = "TwoColumnR"

	// TabDisplayDocTitle 标签页显示文档标题。
	TabDisplayDocTitle = "DocTitle"
	// TabDisplayFileName 标签页显示文件名。
	TabDisplayFileName = "FileName"

	// ZoomModeDefault 使用默认缩放。
	ZoomModeDefault = "Default"
	// ZoomModeFitHeight 适应高度。
	ZoomModeFitHeight = "FitHeight"
	// ZoomModeFitWidth 适应宽度。
	ZoomModeFitWidth = "FitWidth"
	// ZoomModeFitRect 适应页面。
	ZoomModeFitRect = "FitRect"
)

文档视图首选项 CT_VPreferences 的取值。

View Source
const (
	// DocTypeOFD 是基础 OFD,取 GB/T 33190 的一般版式文档。
	DocTypeOFD = "OFD"
	// DocTypeOFDA 是档案长期保存 profile,取 GB/T 42133—2022《信息技术
	// OFD档案应用指南》6.2.1 a):该标准按「禁用清单」限制 OFD 特性以满足
	// DA/T 47 的长期保存要求,并规定阅读软件见到该取值时应禁用插入页面、
	// 调整页面等文档编辑功能。
	DocTypeOFDA = "OFD-A"
	// DocTypeOFDH 是电子病历版式文档 profile。该取值出自
	// GB/T 48666-2026《电子病历版式文档技术要求》7.1 a),该标准在
	// GB/T 33190 与 GB/T 42133 的基础上叠加医疗领域要求,并把阅读软件的
	// 限制扩大到全部文档编辑功能。该标准目前为征求意见稿,条款与取值可能
	// 变化。
	DocTypeOFDH = "OFD-H"
)

DocType 是 OFD.xml 根节点 DocType 属性的取值,用于声明文档遵循的 profile。标准正文本身不校验该属性的具体取值,而是由各领域应用规范 收紧,因此取值随 profile 变化。

View Source
const Namespace = "http://www.ofdspec.org/2016"

Namespace 是标准 OFD 命名空间。

View Source
const RootDocument = "OFD.xml"

RootDocument 是 OFD 包根文档的文件名。

Variables

DocTypes 是全部已知 DocType 取值,按 profile 从通用到专用排列。

Functions

func IsDocType

func IsDocType(value string) bool

IsDocType 判断 value 是否为已知 DocType 取值。

Types

This section is empty.

Jump to

Keyboard shortcuts

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