Solved

Convert Byte array to XML

Posted on 2004-08-09
2
1,133 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

685 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