convert .tif files to PDF using Adobe acrobat API. We own the Adobe acrobat pro enterprise license. OS : Windows


could 1 please tell me how convert .tif files pdf using adobe acrobat api. own adobe acrobat pro enterprise license. os : windows

 

i tried code below in python. code works when trying convert pdf other formats. not .tif pdf.

 

def acrobat_extract_pdf(f_path, f_path_out, f_basename, f_ext):

    avdoc = dispatch("acroexch.avdoc") # connect adobe acrobat

 

 

    # open input file (as pdf)

    ret = avdoc.open(f_path, f_path)

    assert(ret) # fixme: documentation says "-1 if file opened successfully, 0 otherwise", bool in practise?

 

 

    pddoc = avdoc.getpddoc()

 

 

    dst = os.path.join(f_path_out, ''.join((f_basename, f_ext)))

    print(dst)

    # adobe documentation says "for reason, must rely on documentation know functionality available through jsobject interface. details, see javascript acrobat api reference"

    jsobject = pddoc.getjsobject()

 

 

    # here can save many other types using, instance: "com.adobe.acrobat.xml"

    jsobject.saveas(dst, "com.adobe.acrobat.pdf")

 

 

    pddoc.close()

    avdoc.close(true) # want close acrobat, otherwise acrobat going refuse processing further files after threshold of open files reached (for example 50 pdfs)

    del pddoc



More discussions in Acrobat SDK


adobe

Comments

Popular posts from this blog

Reader DC

AdobeIDの作り方

Adobe InDesign CC 2017 has stopped working