how to globally replace font in a PDF

和自甴很熟 提交于 2019-12-23 08:07:10

问题


Is it possible, using Adobe Acrobat or another tool, to globally replace a font in a PDF?

How can I do this?


回答1:


Without seeing your particular file it is hard to say that this would definitely work. But, typically a font is defined like this:

/Resources << 
  /Font << /F13 1 0 R >> 
>>

1 0 obj << 
  /Type /Font
  /Subtype /Type1 
  /BaseFont /Helvetica
>> endobj

The font resource is then used as /F13 12 Tf wherever text is drawn with it.

If you were to change the /BaseFont in the definition, it would affect all uses of that font resource.




回答2:


Replacing a font in a PDF is generally not a good idea. You should not expect behavior similar to replacing a font in e.g. a MS Word document. In PDF, individual glyphs or runs of glyphs are positioned absolutely. At the time the PDF was generated, this positioning was based on the respective widths (and other metrics) of the glyphs in the used font. When you replace a font, the position of the glyphs will remain unchanged, but in general the widths of the glyphs will differ from those in the original font. This will cause distorted text formatting like this:



来源:https://stackoverflow.com/questions/17689487/how-to-globally-replace-font-in-a-pdf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!