I need to strip both text and images from an EPS file generated from a PDF file.. I only want to leave the vector graphic

I found a way to strip all text

$ pdftocairo -eps test.pdf - | sed '/BT/,/ET/ d' > myimage.eps

Now I just need to strip all images

1 Answer 1


As mentioned in my comment on How to extract vectors from a PDF file?, you can do it from the command line like so:

pdftocairo -eps  diagram.pdf  - | 
    sed '/BT/,/ET/ d; /^8 dict dup begin$/,/^Q$/ c Q' > vector.eps

If you need to extract page 30 (for example) of a document, use pdfcairo -f 30 -l 30 ....

  • NOTE: This is not a general solution for EPS. This works only with pdftocairo.
    – hackerb9
    Mar 16, 2018 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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