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
Visual Basic.NET

Avatar of undefined
Last Comment
bbrian51

8/22/2022 - Mon
Nasir Razzaq

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
kaufmed

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
bbrian51

ASKER
Thanks
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck