LaTeX : EPS(MATLAB Figures) To PDF With Embedded Fonts

epstopdf and gs (ghostscript) must have been installed successfully before running this script.

You can install with this command:

sudo apt-get install ghostscript texlive-font-utils

#!/bin/bash

# eps file to pdf with embedded fonts

file="untitled1.eps"
epstopdf  --outfile='.temp.pdf' $file
newfile="${file%%.*}.pdf"
gs -dSAFER -dNOPLATFONTS -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=letter -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile=$newfile -f .temp.pdf
rm .temp.pdf

 

Share