code snippet:
- Code: Select all
Dim ImageID As Long
Forms("MyForm").Imaging1.TiffOpenMultiPageAsReadOnly (True)
ImageID = Forms("MyForm").Imaging1.TiffCreateMultiPageFromFile(tifFileName)
If ImageID = 0 Then
errorcode = 1
errorstr = "Error loading the TIFF file."
Exit Sub
End If
result = Forms("MyForm").Imaging1.SaveAsPDFEx(PDFFileName)
Forms("MyForm").Imaging1.CloseImage (ImageID)
If result = False Then
errorcode = 1
errorstr = "Error saving image into the PDF file."
Exit Sub
End If
An error occurs on the line 'result = ...SaveAsPDFEx...' - with an error description 'Automation error The object invoked has disconnected from its clients.' At that moment I can still use the Imaging object (get page counts, etc - it's GetStat returns 0)
As I say this only happens once in a while and I've tried looking at the tif files to figure out what is different but I haven't had much luck. In at least one case the first page of a bad file is in landscape and the rest of the file is in portrait. Can that cause a problem? I can load the tif into the GDViewer with no trouble - and I've tried flipping all the pages and saving that edit - no change in the error when I try to save as pdf.
I can send an example of a problem tif file if you like.
Thanks for any assistance!
-jennifer
