how to open document?

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
vivekpatel
User
Posts: 141
Joined: Sat Aug 27, 2016 11:00 am

how to open document?

Post by vivekpatel »

Hello,
How to open document using IStreamWrapper without loading file in pdfcontrol?

Here is my sample:

Dim clbk As AuthCallback_Pwd_PDF = New AuthCallback_Pwd_PDF()

Dim Doc As PDFXEdit.IPXC_Document '= m_pxcInst.OpenDocumentFromFile(path, clbk)

Dim _FileMemorystream As New MemoryStream
Dim blnReturn As Boolean
blnReturn = ReadFileStream(_FileMemorystream, IO.Path.GetFileName(Path), 3)
If (_FileMemorystream IsNot Nothing) Then
Dim srcIStream As IStreamWrapper = New IStreamWrapper(_FileMemorystream)
Doc = m_pxcInst.OpenDocumentFrom(srcIStream, clbk) -----> Here it gives exception "Exception from HRESULT: 0x82140002"
End If

Regards.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: how to open document?

Post by Sasha - Tracker Dev Team »

Hello vivekpatel,

I've confirmed this behavior - we'll see whether we can come up with the solution.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: how to open document?

Post by Sasha - Tracker Dev Team »

Hello vivekpatel,

Can you please show the implementation of your IStream.RemoteRead method.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
vivekpatel
User
Posts: 141
Joined: Sat Aug 27, 2016 11:00 am

Re: how to open document?

Post by vivekpatel »

Hello,
Here i'm sending my IstreamWrapper file.
code:

Dim clbk As AuthCallback_Pwd_PDF = New AuthCallback_Pwd_PDF()

Dim Doc As PDFXEdit.IPXC_Document '= m_pxcInst.OpenDocumentFromFile(path, clbk)

Dim _FileMemorystream As New MemoryStream
Dim blnReturn As Boolean
blnReturn = ReadFileStream(_FileMemorystream, IO.Path.GetFileName(Path), 3)
If (_FileMemorystream IsNot Nothing) Then
Dim srcIStream As IStreamWrapper = New IStreamWrapper(_FileMemorystream)
Doc = m_pxcInst.OpenDocumentFrom(srcIStream, clbk)
End If
Attachments
IStreamWrapper.rar
(1.2 KiB) Downloaded 73 times
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: how to open document?

Post by Sasha - Tracker Dev Team »

Hello vivekpatel,

Try debugging the IStream_Read method and see whether it correctly reads the data from the stream and also if no exceptions occur.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply