Quantcast
Channel: Adobe Community: Message List - Acrobat SDK
Viewing all articles
Browse latest Browse all 10848

Avoid Info messages from Acrobat when open broken PDF document

$
0
0

I'm using Adobe SDK to check and fix a bunch of PDF files

 

Dim avDoc As AcroAVDoc = Nothing
    Dim pdDoc As 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 As Exception
        Me.logger.Error(String.Format("Error while converting {0} to {1}. The 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 I try to open PDF that can't be opened for some reason the info message appeares

Capture.PNG

How to avoid this?


Viewing all articles
Browse latest Browse all 10848

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>