Opening documents suddenly fails

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Viewer for .NET (v1.x)  /  Display Thread

DynamicPDF Viewer for .NET (v1.x) Forum

 Jul 06 2015 6:47 AM
Hello,

I'm trying to open a document from isolated storage via stream. it has worked before, but for some unknown to me reason it suddenly fails.

Here is my code:

If Me.isoStore Is Nothing Then
                Me.isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User Or IsolatedStorageScope.Assembly, Nothing, Nothing)
            End If

            Me.workingCopyPath = Path.Combine(My.Settings.TempFolder, Path.GetFileName(filePath))
            Console.WriteLine(Me.workingCopyPath)

            If Me.isoStore.FileExists(Me.workingCopyPath) Then

            Using isoStream As New IsolatedStorageFileStream(Me.workingCopyPath, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite, Me.isoStore)

                Dim tempDoc As New ceTe.DynamicPDF.Viewer.PdfDocument(isoStream)

                If tempDoc IsNot Nothing Then
                    Console.WriteLine(tempDoc.Author)
                    Console.WriteLine(String.Format("pages: {0}", tempDoc.PageCount))
                    Me.pdfViewer.Open(tempDoc)
                Else
                    Console.WriteLine("temp doc is nothing")
                End If
            End Using
            End If

If fails at "Dim tempDoc As New ceTe.DynamicPDF.Viewer.PdfDocument(isoStream)" with a ceTe.DynamicPDF.Viewer.DocumentLoadException and message: "Document could not be loaded (0)" and that's it. I have verified that there is a PDF file under Me.workingCopyPath [by iterating over isoStore].

Any ideas? maybe at leats how I can get a useful error message [stacktrace/exception message]?

Thanks in advance.
 Jul 07 2015 12:04 PM
Posted by a ceTe Software moderator
Hello,

If you are not using the latest DynamicPDF Viewer for .NET product DLL file then it is suggested to use the latest in your application and see if it works for you. You can download the latest product by logging into our CustomerArea using your product serial number. Remove reference for the older DLL file and reference the latest in your application.

If you are evaluating the product then you can download the product from our website here.

Also try to save the stream to disk where the application is running to ensure you are getting valid stream data.

Regarding getting the complete error message you can use Try catch block and log the full error message using properties and methods of Exception class.

If you continue getting the similar behavior even after using the latest and making sure of correct stream data then please send over the following details to support@cete.com so that we can look into it further.

1.Input PDF using which you are getting error.
2.Sample application or code sample which uses static data so we can recreate the error.
3.Exact build number of the product DLL used in the application. You can get this information in DLL references properties (Version field) in Visual Studio.
4.Operating system details: Name, x86 or x64.
5.Are you able to save the file to disk using the stream and open the saved file using other PDF readers?

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 2:27 PM.