How to embed all LaTex fonts in PDF files under Linux

  
                

If you don't embed a font when you create a PDF file, it may cause different styles on different PDF browsers and operating systems. Fonts may also be missing when printing documents, so in PDF It is necessary to embed fonts in the file. The following small series will introduce you to the method of embedding all the fonts of LaTex in PDF files under Linux.

Question: I generated a PDF document by compiling the LaTex source file. However, I noticed that not all fonts are embedded in the PDF document. How can I ensure that all fonts are embedded in a PDF document generated by LaTex?

Answer: When you create a PDF file, it is a good idea to embed the font in the PDF file. If you don't embed fonts, the PDF browser can use something else instead of fonts on your computer. This will result in files being rendered in different styles on different PDF browsers or operating system platforms. The missing font is a problem when you print out the document.

When you generate PDF documents from LaTex (eg with pdflatex or dvipdfm), may not all fonts are embedded in a PDF document. For example, the output below pdffonts suggests missing fonts (such as Helvetica) in the PDF document.

In order to avoid such a problem, here is how to embed all fonts in 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 can see all the fonts It is embedded in the PDF. Methods

The above is embedded in the PDF file under Linux LaTex all fonts should be noted that, when to PDF files with embedded fonts best of all fonts, missing part could cause problems font.

Copyright © Windows knowledge All Rights Reserved