使用 pdf2htmlEx 工具将 pdf 转换为 html 期间字体未对齐

Font misalignment during pdf to html conversion using pdf2htmlEx tool

PDF 到 HTML 转换的字体问题

  1. 所有 "ti"、"fi"、"tt" 个字符丢失

SAMPLE SCREENSHOT

  1. 字体重叠问题

SAMPLE SCREENSHOT

我正在使用

pdf2htmlEX --split-pages 1 --zoom 3 --fit-width 920 --correct-text-visibility 1 --dest-dir 2>&1

尝试过

使用 --fallback 1 选项解决了我上面所有的问题。但是

  1. 回退选项降低了文档的清晰度。
  2. 页面中的
  3. Table 消失了,取而代之的是空 space.

疑问

  1. Could you please explain a bit more on fallback?

  2. I have tried the above one (using fallback). Please suggest me if you prefer a different approach to solve the above problem with fonts.

使用 chrome 和 safari 遇到上述问题,而在 Firefox 中它工作正常。

上述问题仅出现在 - webkit 网络浏览器,如 chrome 和 safari - 提供连字支持 - 而浏览器如 firefox 则不支持。

A ligature is a combination of two or more letters joined as a single glyph

根本原因

这个缺少字符的问题是由于这些现代浏览器提供的连字支持造成的 - 让我解释一下如何

1.The 转换时的工具 - 它使用 poppler 将字符转换为字形进行渲染 - 现在这些浏览器在遇到 tt tf ti ff fi 等字符时将它们视为连字并搜索对应于 tt 的字形而不是 t t

2.Since 他们没有相应的字形 - 他们只是跳过字符并呈现其余部分 - 所以,我们发现字符丢失

可以通过

解决

在这些浏览器中禁用/关闭连字 - 在生成的内容中嵌入 css

更多详情请参考:

  • Prevent ligatures in Safari (Mavericks/iOS7) via CSS

如有错误请指正