html

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 html 为 converter 注册 HTML/MHTML 导入器,以及到 PDF 的直接 转换器。渲染通过 chromedp 驱动 Chrome/Chromium 的打印引擎完成:X→OFD 走 Chrome 转 PDF 后再由 pdf2ofd 生成 OFD;X→PDF 则由 Chrome 直接输出。

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

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

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

Jump to

Keyboard shortcuts

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