Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to convert from byte[] to stream?

Posted on 2007-11-18
2
Medium Priority
?
5,550 Views
Last Modified: 2013-12-17
I have this

byte[] pdfBytes = myPdfConverter.GetPdfBytesFromHtmlString(output);

which is a pdf content, and I want to do:

pdfMerge.AppendPDFStream(StreamObject);

How can I convert the pdfBytes into a stream object, so that the pdfMerge could append it.
0
Comment
Question by:jtcy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 1000 total points
ID: 20309670
use a MemoryString, something like:

MemoryStream ms = new MemoryStream(pdfBytes);
pdfMerge.AppendPDFStream(ms);
0
 
LVL 16

Assisted Solution

by:McExp
McExp earned 1000 total points
ID: 20309671
The following should work.
byte[] pdfBytes = myPdfConverter.GetPdfBytesFromHtmlString(output);
Stream StreamObject = new MemoryStream(pdfBytes);
pdfMerge.AppendPDFStream(StreamObject);

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question