Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have PDF graphic in which I would like to have fonts removed. All other properties of the file should remain (such as size, etc). The output file should be in PDF as well. The text itself should be converted to outlines.

Can I do it at the moment of including the PDF figure in pdftex document? Or can I perhaps use a magic ghostscript command?

share|improve this question
This looks like a duplicate of tex.stackexchange.com/questions/23407/… –  Joseph Wright Sep 3 '11 at 8:03
Well, because this is a figure and not a page, the output after pdf2ps and then ps2pdf is a full-page document. The size has been lost... –  ronszon Sep 3 '11 at 8:25
Do you mean that you have a lot of white space around the figure? So the final step can be to use pdfcrop (included in TeXLive, don't know in MikTeX). –  Spike Sep 3 '11 at 8:53
Brilliant! That does what I wanted. I will update the question with an answer. –  ronszon Sep 3 '11 at 10:02
Rather than answering your question within the question itself, you should add a separate answer. –  lockstep Sep 3 '11 at 12:05

3 Answers 3

In my case (pdftops 0.18.4, GPL Ghostscript 9.05) the resulting PDF following the above answer still contained the fonts and the text was not converted to curves. However, the answer I found at this Malaysian LaTeX User Group site worked for me. This is the script I used:


if [ "x$1" = "x" -o "x$2" = "x" ]; then
    echo Usage: `basename "$0"` "<input.pdf>" "<output.pdf>" >&2
    exit 1

gs -sDEVICE=pswrite -dNOCACHE -sOutputFile=- -q -dbatch \
   -dNOPAUSE -dQUIET "$1" -c quit | ps2pdf - "$2"

Of course, a pdfcrop step can still be added if you need it.

If this gives you an error use -sDEVICE ps2write

share|improve this answer
Excellent! None of the answers in the linked questions worked. Your script does work. –  Emit Taste Jun 25 at 15:23
Thank you! If the OP is available, I would certainly nominate this post for being the appropriate and most effective answer. –  eacousineau Oct 8 at 21:11

(Originally posted as part of question by OP ronszon)

The solution to the problem was conversion from PDF to PS, PS to PDF and cropping final PDF file.

pdftops myfile.pdf
ps2pdf myfile.ps
pdfcrop myfile.pdf
share|improve this answer
I don't know what you think that should do, but it does not convert the fonts to outlines (at least not with gs 9.05). –  Martin Schröder Oct 4 '12 at 21:25

The -sDEVICE=pswrite output driver in Ghostscript has been deprecated since 12/15/2010. In Ghostscript versions >= 9.09, use ps2write or eps2write.

share|improve this answer
The question is 3 years old. You should tell that gs could have changed also options etc. Does it (I do not know)? BTW: Welcome to TeX.SE! –  Kurt Dec 10 at 17:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.