TranslateProject/sources/tech/20140925 Linux FAQs with Answers--How to embed all fonts in a PDF document generated with LaTex.md
2014-09-25 16:26:15 +08:00

2.2 KiB

Linux FAQs with Answers--How to embed all fonts in a PDF document generated with LaTex

Question: I generated a PDF document by compiling LaTex source files. However, I noticed that not all fonts used are embedded in the PDF document. How can I make sure that all fonts are embedded in a PDF document generated from LaTex?

When you create a PDF file, it is a good idea to embed fonts in the PDF file. If you don't embed fonts, a PDF viewer can replace a font with something else if the font is not available on the computer. This will cause the document to be rendered differently across different PDF viewers or OS platforms. Missing fonts can also be an issue when you print out the document.

When you generate a PDF document from LaTex (for example with pdflatex or dvipdfm), it's possible that not all fonts are embedded in the PDF document. For example, the following output of pdffonts says that there are missing fonts (e.g., Helvetica) in a PDF document.

To avoid this kind of problems, here is how to embed all fonts at LaTex compile time.

$ latex document.tex
$ dvips -Ppdf -G0 -t letter -o document.ps document.dvi
$ ps2pdf -dPDFSETTINGS=/prepress \
-dCompatibilityLevel=1.4 \
-dAutoFilterColorImages=false \
-dAutoFilterGrayImages=false \
-dColorImageFilter=/FlateEncode \
-dGrayImageFilter=/FlateEncode \
-dMonoImageFilter=/FlateEncode \
-dDownsampleColorImages=false \
-dDownsampleGrayImages=false \
document.ps document.pdf 

Now you will see that all fonts are properly embedded in the PDF file.


via: http://ask.xmodulo.com/embed-all-fonts-pdf-document-latex.html

译者:译者ID 校对:校对者ID

本文由 LCTT 原创翻译,Linux中国 荣誉推出