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
3  
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
3  
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
2  
Rather than answering your question within the question itself, you should add a separate answer. –  lockstep Sep 3 '11 at 12:05

2 Answers 2

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:

#!/bin/sh

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

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
1  
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

Your Answer

 
discard

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.