Solved

Convert Byte array to XML

Posted on 2004-08-09
2
1,121 Views
Last Modified: 2010-05-18
Hi,

I have created a PDF document using a third party component and I can get the results as a Byte Array. I now need to add this to a xml document to be returned from a webservice. How do I go about this? I have looked at serialization but can't get my head around it!

Is my best method to save the PDF to a file and then read it into the XML of is there another method?

Either way, how is it done?

Thanks,

Smert
0
Comment
Question by:smert
2 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 500 total points
ID: 11754703
well if you have it in a byte array ...

just to get Document ...

public function GetDocument(byval name as string) as byte ()
      return InternalGetDocument(name)
end function

that can be used as a webmethod to return the document without issue ...

If you would rather read it as if it were a stream you can use ...

Dim ms as MempryStream = new MemoryStream(InternalGetDocument(name))

then you can access it with a streamreader etc ...
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now