Documentation
¶
Overview ¶
Package pdf2ofd 提供纯 Go 的 PDF 到 OFD 转换实现:解析 PDF 页面几何、文字、 路径和图像 XObject,并使用 pkg/creator 输出 OFD 包,不依赖原生 PDF 渲染器。
Index ¶
- Variables
- func Convert(gctx context.Context, input any, output io.Writer, password string) error
- func ConvertFile(gctx context.Context, pdfPath, ofdPath string, password string) error
- func ConvertFileWithOptions(gctx context.Context, pdfPath, ofdPath string, password string, ...) error
- func ConvertWithOptions(gctx context.Context, input any, output io.Writer, password string, ...) (err error)
- type Diagnostic
- type LimitError
- type Limits
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEncrypted = errors.New("文档已加密")
ErrEncrypted 表示输入 PDF 已加密但没有可用口令。
View Source
var ErrLimitExceeded = config.ErrLimitExceeded
View Source
var ErrUnsupported = config.ErrUnsupported
View Source
var ErrWrongPassword = errors.New("口令不正确")
ErrWrongPassword 表示提供的口令无法打开 PDF。
与 ErrEncrypted 分开是因为处置不同:前者调用方补个口令就能继续,后者 是口令给错了,重试同一份不会变。
Functions ¶
func Convert ¶
Convert 把 PDF 输入(文件路径、[]byte、io.Reader 或 io.ReadSeeker)转换为 OFD 包。转换保留基本页面几何、文字、路径和 JPEG/PNG 图像 XObject, 不使用原生 PDF 渲染器。
func ConvertFile ¶
ConvertFile 是 Convert 的按路径便捷形式。
Types ¶
type Diagnostic ¶ added in v0.1.5
type Diagnostic = config.Diagnostic
type LimitError ¶ added in v0.1.5
type LimitError = config.LimitError
Source Files
¶
- annotation.go
- colorspace.go
- control.go
- convert.go
- font.go
- font_cmap.go
- font_cmap_predefined.go
- font_semantic.go
- font_type3.go
- font_vertical_glyph.go
- function_type4.go
- image.go
- image_control.go
- image_jpeg_decode.go
- image_jpx.go
- image_jpx_colour.go
- image_jpx_openjpeg_stub.go
- image_mask.go
- image_mask_compressed.go
- image_mask_coordinates.go
- image_mask_jpx.go
- image_matte.go
- image_matte_jbig2.go
- image_matte_jpeg.go
- image_matte_jpx.go
- image_softmask.go
- link.go
- merge.go
- mesh.go
- metadata.go
- outline.go
- path.go
- pattern.go
- pdf_content.go
- shading.go
- text.go
- text_clip.go
- text_vertical.go
- transparency.go
- transparency_blend.go
- transparency_mask.go
- types.go
- util.go
Click to show internal directories.
Click to hide internal directories.