office

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package office 为 converter 注册 Office 文档(doc/docx/odt/rtf/wps/ pptx/xlsx 等)的导入器,以及到 PDF 的直接转换器。转换通过 LibreOffice 命令行完成:X→OFD 走 LibreOffice 转 PDF 后再由 pdf2ofd 生成 OFD; X→PDF 则由 LibreOffice 直接输出。

该包依赖 LibreOffice 可执行文件,单独成包是为了让不需要 Office 转换的 使用方不必链接这些依赖;需要时按空白导入启用:

import _ "github.com/zc310/ofd/pkg/converter/import/office"

之后即可使用 converter.Convert(ctx, "docx", "ofd", ...) 或 converter.Convert(ctx, "docx", "pdf", ...)。运行环境必须安装 LibreOffice, 否则返回明确错误。

Jump to

Keyboard shortcuts

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