How to open PDF file using MemoryStream?

PDF-XChange Editor SDK for Developers

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

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 PDF file using MemoryStream?

Post by vivekpatel » Mon Mar 27, 2017 8:10 am

Hello,

How to open PDF file using MemoryStream?

Suppose,
I have temppath as MemoryStream and pdfcontrol as pdfctrl.
now i write,

pdfctrl.OpenDocFrom(temppath )
gives "Exception has been thrown by the target of an invocation." exception.

please give me a solution. i'm looking forward to it.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13819
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: How to open PDF file using MemoryStream?

Post by Tracker Supp-Stefan » Mon Mar 27, 2017 8:40 am

Hello vivekpatel,

Please make sure that you post your questions in the correct forums so that we can help you in the most efficient way!
You posted an Editor SDK question in the end user Viewer section. This is not monitored by developers, so you might get a delayed reply (or not the correct one at all)!

I will now move the topic to the correct forum so that it can be addressed properly.

Regards,
Stefan

JSantmann@Wellsoft.com
User
Posts: 9
Joined: Wed Mar 29, 2017 1:36 am

Re: How to open PDF file using MemoryStream?

Post by JSantmann@Wellsoft.com » Wed Mar 29, 2017 2:08 am

I have the same question.
How do you read/write the full PDF file contents of the "Editor" from/to a buffer (for example a MemoryStream)?
Thanks.

User avatar
Sasha - Tracker Dev Team
User
Posts: 4595
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to open PDF file using MemoryStream?

Post by Sasha - Tracker Dev Team » Wed Mar 29, 2017 12:05 pm

Hello JSantmann@Wellsoft.com,

You mean you want to open the PDF document form the buffer and save it into the buffer? For that you should pass the IStream derived class into the http://sdkhelp.tracker-software.com/vie ... penDocFrom
The example on how to implement the IStream interface is in our FullDemo sample project.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
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 PDF file using MemoryStream?

Post by vivekpatel » Mon Apr 03, 2017 5:30 am

Hello,

How can i do this vb.net?
i did memorystream to filestream to istream, but doesn't work.
what i have to do?
please help to open document with memorystream.

User avatar
Sasha - Tracker Dev Team
User
Posts: 4595
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to open PDF file using MemoryStream?

Post by Sasha - Tracker Dev Team » Mon Apr 03, 2017 6:52 am

Hello vivekpatel,

What exactly does not work for you and what have you implemented? Have you checked the FullDemo application like I advised in my previous post?

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
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 PDF file using MemoryStream?

Post by vivekpatel » Wed Apr 26, 2017 11:57 am

Hello,
It is possible to open images using IStreamWrapper?
I have tried to open image file in FullDemo sample project using IStreamWrappe, which produce exception.
i'm looking forward to it.

User avatar
Sasha - Tracker Dev Team
User
Posts: 4595
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to open PDF file using MemoryStream?

Post by Sasha - Tracker Dev Team » Wed Apr 26, 2017 12:19 pm

Hello vivekpatel,

I have also experienced problems with this - we will investigate this.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
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 PDF file using MemoryStream?

Post by vivekpatel » Fri Apr 28, 2017 5:31 am

Hello,
Did you get any solution?
i'm looking forward to it.
Thanks in advance.

User avatar
Sasha - Tracker Dev Team
User
Posts: 4595
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to open PDF file using MemoryStream?

Post by Sasha - Tracker Dev Team » Fri Apr 28, 2017 7:47 am

Hello vivekpatel,

After further investigation it appeared that everything worked correctly. Please describe what exactly are you doing to reproduce this behavior. Here's my settings:
Capture1.PNG
Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
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 PDF file using MemoryStream?

Post by vivekpatel » Fri Apr 28, 2017 9:24 am

Hello,
I did the same.
here i'm attaching my FullDemo sample.
Attachments
FullDemo.rar
(821.35 KiB) Downloaded 54 times

User avatar
Sasha - Tracker Dev Team
User
Posts: 4595
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to open PDF file using MemoryStream?

Post by Sasha - Tracker Dev Team » Fri Apr 28, 2017 9:26 am

Hello vivekpatel,

Have you tried doing this on the clean FullDemo project? Or have you modified something? Also, if you can, please provide a file sample that you have troubles with.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
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 PDF file using MemoryStream?

Post by vivekpatel » Fri Apr 28, 2017 10:00 am

Hello,
No there is no change in FullDemo project and i have clean and rebuild the project, but issue is there.

User avatar
Sasha - Tracker Dev Team
User
Posts: 4595
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to open PDF file using MemoryStream?

Post by Sasha - Tracker Dev Team » Fri Apr 28, 2017 10:02 am

Then I will need your file samples and version of the dll.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
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 PDF file using MemoryStream?

Post by vivekpatel » Fri Apr 28, 2017 10:07 am

Hello,
Can i get your FullDemo?

User avatar
Sasha - Tracker Dev Team
User
Posts: 4595
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to open PDF file using MemoryStream?

Post by Sasha - Tracker Dev Team » Fri Apr 28, 2017 10:08 am

It's the same clean FullDemo project.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
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 PDF file using MemoryStream?

Post by vivekpatel » Fri Apr 28, 2017 10:11 am

Hello,

Which dll i have to send?

vivekpatel
User
Posts: 141
Joined: Sat Aug 27, 2016 11:00 am

Re: How to open PDF file using MemoryStream?

Post by vivekpatel » Fri Apr 28, 2017 10:33 am

Hello,
i'm facing the file upload problem. So, i con't upload my files and dll.
what next i have to do?

User avatar
Will - Tracker Supp
Site Admin
Posts: 6826
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: How to open PDF file using MemoryStream?

Post by Will - Tracker Supp » Fri Apr 28, 2017 10:45 am

Hi Vivek,

Files need to be wrapped in a ZIP folder or 7zip/RAR archive to be uploaded.

Thanks,
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com

vivekpatel
User
Posts: 141
Joined: Sat Aug 27, 2016 11:00 am

Re: How to open PDF file using MemoryStream?

Post by vivekpatel » Fri Apr 28, 2017 11:29 am

Hello,
I have "PDFXEditCore.x86.dll" with version 6.0.317.1.

User avatar
Sasha - Tracker Dev Team
User
Posts: 4595
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to open PDF file using MemoryStream?

Post by Sasha - Tracker Dev Team » Fri Apr 28, 2017 11:40 am

Hello vivekpatel,

Please update to the latest version.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
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 PDF file using MemoryStream?

Post by vivekpatel » Mon May 01, 2017 12:02 pm

Hello,
I have updated new version 6.0.321.0.
Still it can't open image file using IStreamWrapper.

vivekpatel
User
Posts: 141
Joined: Sat Aug 27, 2016 11:00 am

Re: How to open PDF file using MemoryStream?

Post by vivekpatel » Tue May 02, 2017 11:32 am

Hello,
Did you get any solution?
i'm looking forward to it.
Thanks in advance.

User avatar
Will - Tracker Supp
Site Admin
Posts: 6826
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: How to open PDF file using MemoryStream?

Post by Will - Tracker Supp » Tue May 02, 2017 12:28 pm

Hi Vivek,

Yesterday was a holiday in most of Europe, as is today where Alex is. He'll take a look at this as soon as he's able, tomorrow or shortly thereafter.

**Edit** Alex was briefly in touch and has requested a sample image that you cannot open.

Thanks,
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com

vivekpatel
User
Posts: 141
Joined: Sat Aug 27, 2016 11:00 am

Re: How to open PDF file using MemoryStream?

Post by vivekpatel » Thu May 04, 2017 6:53 am

Hello,
Here i'm attaching my images.
Attachments
Desktop.rar
(1.49 MiB) Downloaded 45 times

User avatar
Sasha - Tracker Dev Team
User
Posts: 4595
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to open PDF file using MemoryStream?

Post by Sasha - Tracker Dev Team » Thu May 04, 2017 2:23 pm

Hello vivekpatel,

Every one of them opened successfully:
Capture.PNG
Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
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 PDF file using MemoryStream?

Post by vivekpatel » Fri May 05, 2017 5:06 am

Hello,
on your side it's ok.
i have updated PDFXEditCore.x86.dll to 6.0.321.
is there any problem on my side?
It's not open in FullDemon that tracker provided.
what i have to do? please help me to getting out.

User avatar
Sasha - Tracker Dev Team
User
Posts: 4595
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to open PDF file using MemoryStream?

Post by Sasha - Tracker Dev Team » Fri May 05, 2017 2:56 pm

Hello vivekpatel,

I've copied the needed code from the FullDemo application and created a small project for you.

Cheers,
Alex
Attachments
OpenFileUsingMemorySteram.rar
(208.83 KiB) Downloaded 44 times
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
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 PDF file using MemoryStream?

Post by vivekpatel » Mon May 08, 2017 5:29 am

Hello And Thanks,
Thanks for the demo. But Still it produce error in your demo.
Here i'm attached error image.
Attachments
Img_with_streamwap.rar
(76.27 KiB) Downloaded 44 times

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13819
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: How to open PDF file using MemoryStream?

Post by Tracker Supp-Stefan » Mon May 08, 2017 12:20 pm

Hello Vivekpatel,

Alex is not in the office today - so he will follow up here tomorrow, but in the mean time - it seems like this is a problem with your setup.
Please take a look here:
http://stackoverflow.com/questions/4550 ... erstanding
And handle this exception so that we can get more info on what is causing it.

Regards,
Stefan

User avatar
Sasha - Tracker Dev Team
User
Posts: 4595
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to open PDF file using MemoryStream?

Post by Sasha - Tracker Dev Team » Tue May 09, 2017 6:45 am

Hello vivekpatel,

You will need to use the try-catch block to handle exceptions - that's basic programming knowledge. After that you can see the exception's description.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
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 PDF file using MemoryStream?

Post by vivekpatel » Wed May 17, 2017 6:33 am

Hello,
I did Try.. Catch Block.
Here i'm sending my IstreamWrapper Class file to figure out prob.
Attachments
IStreamWrapper.rar
(1.13 KiB) Downloaded 43 times

User avatar
Sasha - Tracker Dev Team
User
Posts: 4595
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to open PDF file using MemoryStream?

Post by Sasha - Tracker Dev Team » Wed May 17, 2017 7:37 am

Hello vivekpatel,
I did Try.. Catch Block.
And what was the error that you have caught?

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
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 PDF file using MemoryStream?

Post by vivekpatel » Wed May 17, 2017 8:00 am

Hello,

"Exception has been thrown by the target of an invocation." , exception After IStream_Read() function.

User avatar
Sasha - Tracker Dev Team
User
Posts: 4595
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to open PDF file using MemoryStream?

Post by Sasha - Tracker Dev Team » Wed May 17, 2017 8:06 am

"Exception has been thrown by the target of an invocation." , exception After IStream_Read() function.
Judging by this you have not done the try-catch block correctly as you have not specified the error code and information.
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply