使用Python在Apple中将PDF表转换为Excel

时间:2018-07-30 22:49:53

标签: python excel sdk

我想将PDF中的表转换为Excel。我意识到Adobe Acrobat Pro具有此功能-我想对此进行编程,因为我有很多文件。

Subhobroto's reply in this post解释了如何在python中执行此操作(只需将xls替换为word),但这适用于Windows版本的python。在Mac上使用Python3连接到Adobe Acrobat的类似方法是什么?

def acrobat_extract_text(f_path, f_path_out, f_basename, f_ext):
    avDoc = Dispatch("AcroExch.AVDoc") #  this is the line I need to sub with a method from another module

    # Open the input file (as a pdf)
    ret = avDoc.Open(f_path, f_path)   
    assert(ret) # FIXME: Documentation says "-1 if the file was opened successfully, 0 otherwise", but this is a bool in practise?

0 个答案:

没有答案