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!

上一篇:Spark调研笔记第6篇 - Spark编程实战FAQ


下一篇:Android Studio 报错 must either be declared abstract or implement abstract method