Avoid Info messages from Acrobat when open broken PDF document


i'm using adobe sdk check , fix bunch of pdf files

 

dim avdoc acroavdoc = nothing
    dim pddoc cacropddoc = nothing
    try
        avdoc = new acroavdoc()
        if (avdoc.open(sourcefile.fullname, string.empty)) then
            pddoc = avdoc.getpddoc()
            removeifexists(destinationfile)
            createifnotexits(new directoryinfo(destinationfile.directoryname))
            pddoc.save(3, destinationfile.fullname)
            pddoc.close()
            avdoc.close(1)
            return true
        end if
        return false
    catch generatedexceptionname exception
        me.logger.error(string.format("error while converting {0} {1}. error message: {2}", sourcefile.fullname, destinationfile.fullname, generatedexceptionname.message))
        me.logger.fatal(generatedexceptionname.stacktrace)
        return false
    finally
        if (avdoc isnot nothing) then
            avdoc.close(1)
        end if
        if (pddoc isnot nothing) then
            pddoc.close()
        end if
    end try

 

but when try open pdf can't opened reason info message appeares

capture.png

how avoid this?

open document first pddoc, convert avdoc. use error

handler catch error gets thrown open call when file

cannot opened.

 

pddoc.open("c:\test\dummy.pdf")

pddoc.openavdoc ("")

 

 

karl heinz kremer

pdf acrobatics without net

pdf software development, training , more...

 

khk@khk.net

http://www.khkonsulting.com



More discussions in Acrobat SDK


adobe

Comments

Popular posts from this blog

Some mp4 files not displaying correctly (CS6)

Thread: Samba is not authenticating with LDAP