pdf2eps implement

Well, I used the command pdftops in the LaTeX distribution such as MiKTeX/TeXLive/CTex to implement one pdf2eps command, as follows

@echo off
rem pdf2eps <pdf file without ext>
set filename=%~dpn1
pdfcrop "%filename%.pdf" "%filename%-cropped.pdf"
pdfseparate "%filename%-cropped.pdf" "%filename%-cropped-%%d.pdf"

for /f %%f in ('dir /b %filename%-cropped-*.pdf') do (
	pdftops -f 1 -l 1 -eps "%%~dpnf.pdf" "%%~dpnf.eps"
	del "%%~dpnf.pdf">nul
)
del "%filename%-cropped.pdf">nul

Save it as pdf2eps.bat, and copy it to where pdftops is, and make it available by command prompt, e.g. add corresponding path to environment.

The usage is

pdf2eps "the name of pdf withou extension"

Ok, all done!

posted @ 2019-08-13 16:00  Troy_Daniel  阅读(236)  评论(0编辑  收藏  举报