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
How to avoid this?