How to create an XPS document in a WCF service to store and return?

I've got a WCF service as middle tier, and on some occasions I need to create a printable document, store it for future reference in the database, and return it to the client.

My first choice as file format was XPS, so I'd like to create an XPS document in a WCF service, store it, and return it.

Is there an easy way to achieve this, or some other obvious way to solve my problem (storing and returning a printable document in WCF) I've missed?


Easy? Nothing's easy about XPS.

I'm currently serializing the XPS to a byte array using the XpsSerializerFactory

   using (MemoryStream ms = new MemoryStream())
        var writer = new XpsSerializerFactory().CreateSerializerWriter(ms);
        return ms.ToArray();

I've toyed around with just sending the memory stream that backs the document's package across along with the URI of the document, but I've never tested that.

Need Your Help

How to batch-rename files by date?

linux bash unix rename batch-processing

What commands could I use to rename a few hundred files that are currently named

browser got crashed by executing grid.trigger(“reloadGrid”)

jquery json jqgrid struts2 struts2-jquery

Hi I am trying to reload the jqgrid. I am using struts2-jquery-grid-plugin-3.5.0 in this way

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.