PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)
Moderators:PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
I am using PDF XChange Viewer-ActiveX SDK , version 2.5.214.2 in my own VB .NET application where I am loading a PDF from a FileStream into a PDFXCStream (like in your VBNETExample OpenDocumentFromStream) with the following function:
Public Function PDFLoadIntoPDFXCStream(ByVal PDFilePath As String, Optional PDFileOpenPassword As String = "") As Object Implements IMainPresenter.PDFLoadIntoPDFXCStream
Dim _MemoryStream As IO.MemoryStream
Dim _FileStream As IO.FileStream
Dim _PDFXCStream As IStream
Dim oDataOut(1) As Object
Try
If String.IsNullOrEmpty(PDFilePath) Then Throw New ArgumentNullException("PDFilePath", "Es wurde keine PDF zum Laden in den Speicher übergeben!")
_MemoryStream = New IO.MemoryStream
_FileStream = New IO.FileStream(PDFilePath, IO.FileMode.Open, IO.FileAccess.Read)
'#THK# 20.11.2013 Übergebene PDF in Speicher kopieren, damit diese später überschrieben werden kann
_FileStream.CopyTo(_MemoryStream)
Debug.WriteLine("PDFLoadIntoPDFXCStream - Close FileStream")
_FileStream.Close()
'#THK# 20.11.2013 PDF aus dem Speichern in ein PDFXCStream-Objekt laden (notwendig für PDF-XChange Viewer Steuerelement)
_PDFXCStream = Logic.Factory.CreatePDFXCStream(_MemoryStream)
oDataOut(0) = _PDFXCStream
oDataOut(1) = PDFileOpenPassword
Return oDataOut
Catch ex As System.Exception
Throw New Exception("FEHLER in PDFLoadIntoPDFXCStream: " + ex.Message)
Return Nothing
End Try
End Function
As a result of the function I am getting a PDFXCStream which I am displaying in the view(PDF-XChange Viewer control on windows form) where one user adds one or more annots(mostly rectangle annots). After the user has finished he closes the PDF and I save the loaded PDFXCStream with the annot over the original PDF file. For reviewing the overwritten PDF file I load it one second later with the OpenDocument method but then the PDF-XChange Viewer control on the windows form crashes unregular with the Windows error message "PDF-XChange Viewer has encountered a problem and needs to close". If I open the same file in a row it crashes unregular at one of my tries so I can not find a regularity which makes it harder to reproduce the error.
I don't understand it and hope you can find something out from my attached error reports.
Thanks
Karl
You do not have the required permissions to view the files attached to this post.
or reviewing the overwritten PDF file I load it one second later with the OpenDocument method but then the PDF-XChange Viewer control on the windows form crashes unregular
1. The v2.5.214 is old. Please update to the latest and try reproduce it again.
2. Please be sure that overwriting of original pdf-file is finished exactly, before opening. Do you using multiple threads for saving/opening files?
3. Please check if problem is depended on file or not. Try any other file (new, blank for example).
4. You may create dump-file of crash (with latest version of our SDK), upload it to any public ftp and provide link to it...
5. Also the simple example for reproducing this issue - will be very helpful for us. It may dramatically decrease time of trouble fixing..
Best
Regards.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
thank you for your fast answer and sorry for my late answer!
I have tested the current PDF-XChange Viewer Active SDK, version 2.5.309.0 and the problem still exists. My problem is that I can't exactly reproduce the error on my development computer running Windows 7 x64 but it crashes very often on the client computer running Windows XP x32.
If I do a remote debugging in VB .NET it does not jump to any line in the source code, normally it does but here it generates only Windows error reports.
I will write a simple example and try to reproduce the error!
At the meantime thank you for your help, I will update this post as soon as I found something new