python 转换PDF 到 EPS(Convert PDF from Python to EPS)

from win32com.client.dynamic import ERRORS_BAD_CONTEXT as ebc
from win32com.client import DispatchEx as de
import winerror, os

if winerror.E_NOTIMPL not in ebc:
    ebc.append(winerror.E_NOTIMPL)

adb = de("AcroExch.App")
adc = de("AcroExch.AVDoc")
src = "e://test1.pdf"
dst = "e://test1.eps"
if os.path.exists(dst):
    os.remove(dst)
tp = "com.adobe.acrobat.eps"
jso = None
pdc = None
try:
    if adc.Open(src, ""):
        pdc = adc.GetPDDoc()
        jso = pdc.GetJSObject()
        jso.SaveAs(dst, tp)
except Exception as e:
    print(e)
finally:
    adc.Close(True)
    adc = None
    adb = None
    pdc = None
    jso = None
————————
from win32com.client.dynamic import ERRORS_BAD_CONTEXT as ebc
from win32com.client import DispatchEx as de
import winerror, os

if winerror.E_NOTIMPL not in ebc:
    ebc.append(winerror.E_NOTIMPL)

adb = de("AcroExch.App")
adc = de("AcroExch.AVDoc")
src = "e://test1.pdf"
dst = "e://test1.eps"
if os.path.exists(dst):
    os.remove(dst)
tp = "com.adobe.acrobat.eps"
jso = None
pdc = None
try:
    if adc.Open(src, ""):
        pdc = adc.GetPDDoc()
        jso = pdc.GetJSObject()
        jso.SaveAs(dst, tp)
except Exception as e:
    print(e)
finally:
    adc.Close(True)
    adc = None
    adb = None
    pdc = None
    jso = None