如何在Windows应用商店应用中的按钮单击事件上打开pdf文件? [英] How can I open pdf file on a button click event in windows store app?

查看:202
本文介绍了如何在Windows应用商店应用中的按钮单击事件上打开pdf文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在按钮点击事件上打开pdf文件(通过提供其路径)。在Windows应用商店应用中,什么是最佳解决方案?



我尝试过的方法:



c# - wpf在Adobe Reader中打开PDF文件,点击按钮 - Stack Overflow [ ^ ]

I'm trying to open pdf file (by providing its path) on a button click event. In windows store application, what is the best solution?

What I have tried:

c# - wpf open PDF file in Adobe Reader with a click on a button - Stack Overflow[^]

推荐答案

如果您想在默认查看器中打开PDF,一个简单的1衬里应解决此问题:
If you're wanting to open a PDF in a default viewer, a simple 1 liner should solve this:
Launcher.LaunchUriAsync(new Uri(uri), new LauncherOptions { ContentType="application/pdf" });


这篇关于如何在Windows应用商店应用中的按钮单击事件上打开pdf文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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