如何在WCF服务中创建XPS文档来存储和返回?
我有一个 WCF 服务作为中间层,在某些情况下,我需要创建一个可打印文档,将其存储在数据库中以供将来参考,然后将其返回给客户端。
我的首选文件格式是 XPS,因此我想在 WCF 服务中创建 XPS 文档、存储它并返回它。
有没有一种简单的方法可以实现此目的,或者有其他一些明显的方法来解决我错过的问题(在 WCF 中存储和返回可打印文档)?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简单的? XPS 绝非易事。
我目前正在使用 XpsSerializerFactory 将 XPS 序列化为字节数组,
我曾尝试过仅发送支持文档包的内存流以及文档的 URI,但我从未对此进行过测试。
Easy? Nothing's easy about XPS.
I'm currently serializing the XPS to a byte array using the XpsSerializerFactory
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.