Link to home
Start Free TrialLog in
Avatar of bbrian51
bbrian51

asked on

Saving Object as System.IO.Stream

Hi,

I am having issues converting my PDF object into a Byte() to print. I have a object called myPDF that has the following method definition:

myPDF.SaveMergedPDFToStream(outPDFStream AS System.IO.Stream)

My print routine has the following definition:

myPrinter.SendBytesToPrinter(Bytes() AS Byte)


I can make it work saving the file to disk and then reading it back in...but that seems pointless.

Thanks,
Brian
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

You can use Read method of stream to convert stream to byte array

http://msdn.microsoft.com/en-us/library/system.io.stream.read.aspx
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bbrian51
bbrian51

ASKER

Thanks