0

我想以编程方式(使用 iText)替换现有 PDF 文件中嵌入的字体。

iText 本身似乎没有为字形和字体提供任何数据模型,但我相信它可以让我检索和更新包含字体的二进制流。

即使我不知道哪个字形与哪个字体相关联也没关系——我想做的只是替换它们。准确地说,我想在 PDF 文档中嵌入所有字形。

在渲染时替换字体不是一种选择,因为输出必须是 PDF,所有信息都按原样保留。

以前有没有人用 iText 或任何其他 PDF 库做过这个?

4

1 回答 1

1

PDF files define a set of fonts (ie F0, F1, F2) and then define these separately so you could theoretically rewrite the entry for F0. You would have to ensure the 2 fonts have the same spacing (or you will have to rewrite the PDF as well), and probably hack the PDF manually.

于 2009-07-23T07:17:47.427 回答