编程语言
首页 > 编程语言> > python 转换PDF 到 EPS

python 转换PDF 到 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

标签:None,ebc,python,dst,jso,EPS,adc,PDF,pdc
来源: https://www.cnblogs.com/unm001/p/16267631.html