Convert XOD / XPS to PDF

Q: Is there a way to load a PDFDoc object in PDFNet from an in memory XOD byte array? Basically we are taking a PDFDoc object and converting it to XOD to be consumed by our Silverlight document editor. We are using the code below to get the XOD bytes. How could we go from what is in the “xodBytes” byte array variable in the code below, back to a PDFDoc object?

Filter filter = pdftron.PDF.Convert.ToSilverlight(pdfDoc, silverlightOutputOptions);

using (pdftron.Filters.FilterReader fr = new pdftron.Filters.FilterReader(filter)) {

byte[] buffer = new byte[2048];

MemoryStream ms = new MemoryStream();

int count = 0;

while ((count = fr.Read(buffer)) > 0) {

ms.Write(buffer, 0, count);

}

fr.Flush();

xodBytes = ms.ToArray();

ms.Close();

}

A: Since XOD is a subset of XPS you could use something like the following code:

PDFDoc doc = new PDFDoc();
Convert.FromXps(doc,xodBytes,xodBytes.Length);