EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Converting a TElPDFDocument to a System.IO.Stream

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#3559
Posted: 08/16/2007 04:20:26
by mat clarkson (Standard support level)
Joined: 08/16/2007
Posts: 6

Is there a way to convert a TElPDFDocument to a System.IO.Stream?

I do not want to save the decrypted pdf to disk.
#3560
Posted: 08/16/2007 04:38:19
by Eugene Mayevski (EldoS Corp.)

ElPDFDocument operates with streams, not files. So you always work with System.IO.Stream.


Sincerely yours
Eugene Mayevski
#3561
Posted: 08/16/2007 05:28:08
by mat clarkson (Standard support level)
Joined: 08/16/2007
Posts: 6

I need to open the decrypted document with a PDF viewer, which accepts System.IO.Stream as it's parameter.

When I try to call it using a TElPDFDocument it generates the error "TElPDFDocument cannot be converted to System.IO.Stream"

Thanks for your help
#3562
Posted: 08/16/2007 05:41:39
by Eugene Mayevski (EldoS Corp.)

1) Copy the document to MemoryStream
2) call ElPDFDocument.Open()
3) decrypt the document
4) call ElPDFDocument.Close()
5) Use the memory stream from (1) with your pdf viewer.

See a how-to for more information about decryption procedure.


Sincerely yours
Eugene Mayevski
#3565
Posted: 08/16/2007 06:34:13
by mat clarkson (Standard support level)
Joined: 08/16/2007
Posts: 6

thanks, i think i'm nearly there, how do i get the pdf into a memory stream i'm currently using filestream as per the example...

Dim F As FileStream = New FileStream(TempPath, FileMode.Open, FileAccess.ReadWrite)

#3568
Posted: 08/16/2007 06:57:04
by Eugene Mayevski (EldoS Corp.)

Use Stream's methods to copy information from one stream to another.


Sincerely yours
Eugene Mayevski
#3570
Posted: 08/16/2007 09:08:39
by mat clarkson (Standard support level)
Joined: 08/16/2007
Posts: 6

Sorry, I am new to VB.Net, I cannot see which Stream methods to use?
#3571
Posted: 08/16/2007 09:25:04
by Eugene Mayevski (EldoS Corp.)

Read and Write. Read block ... write block ... read block ... write block ... read block ... write block ... read block ... write block ... read block ... write block ... read block ... write block


Sincerely yours
Eugene Mayevski
#3573
Posted: 08/16/2007 09:54:05
by mat clarkson (Standard support level)
Joined: 08/16/2007
Posts: 6

do you mean readbyte... writebyte?
Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.

Reply

Statistics

Topic viewed 3867 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!