Solved

Convert Byte array to XML

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need a starter for ETL protocol? 4 65
EF5: Question about Metadata Artifact Processing 4 22
Import Data from Multiple Text Files in Excel 12 60
location of a form 2 25
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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