如何在 uwp 中将图像转换为 pdf 和 Word 文档? [英] How can I convert images to pdf and Word document in uwp?

查看:43
本文介绍了如何在 uwp 中将图像转换为 pdf 和 Word 文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发一个应用程序,使用C# 将图像转换为MS Word 文档和uwp 中的pdf 文件>

I want to develop an app which converts images to MS Word document and pdf file in uwp using C#

我应该使用哪些库?uwp 不支持 itextsharp

Which libraries should I use? uwp doesn't support itextsharp

推荐答案

我应该使用哪些库?

Which libraries should I use?

目前没有这样的库.

对于 MS Word 文档,尤其是 2007 之后的版本,它使用 Open-XML-SDK,目前不支持UWP平台.

For MS Word document, especially the version after 2007, it uses Open-XML-SDK and currently it doesn't support UWP platform.

对于PDF,可以尝试自己编写PDF文件格式,这里有一个博客 你可以看看.这可能是一项艰巨的工作.或者,如果您不介意显示打印"用户界面,您可以将所有图像例如放入一个 Grid 并打印它并调用 ShowPrintUIAsync 方法,在这个UI中,有一个按钮可以打印到 PDF 文件.这个方法可以参考官方打印示例.

For PDF, you can try to write the PDF file format yourself, here is a blog you can take a look. This could be a hard work. Or if you don't mind to show the "Print" UI, you can put all your images for example into one Grid and print it and call ShowPrintUIAsync method, in this UI, there is a button you can print to PDF file. For this method, you can refer to the official Printing sample.

我的建议是尝试在线部署或使用可用的服务,让该服务完成这项工作,当工作完成后,您可以简单地下载流并保存到文件中.

My suggestion is that trying to deploy or use an available service online, let the service do this work, and when the work is done, you can simple download the stream and save into files.

这篇关于如何在 uwp 中将图像转换为 pdf 和 Word 文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆