从WinJS应用程序打开PDF文件 [英] Open a PDF file from a WinJS Application

查看:129
本文介绍了从WinJS应用程序打开PDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,用户可以在其中单击一个按钮,并应向其显示存储在该应用程序中的PDF.

I've got an application in which the user clicks a button, and should be presented a PDF that is stored in the application.

他们可以在应用程序内部查看PDF,也可以启动本机Windows PDF查看器.

They can view the PDF internally in the app, or launch the native windows PDF viewer, either way is fine.

如何为单击按钮以启动PDF文件视图提供链接/事件处理程序?

How can I provide a link / event handler for the button click to launch a view of a PDF file?

推荐答案

使用 LaunchFileAsync函数

说明:使用指定的选项启动与指定文件关联的默认应用.

description: Starts the default app associated with the specified file, using the specified options.

示例代码:

Windows.System.Launcher.launchFileAsync(file, options).done( /* Your success and error handlers */ );

这篇关于从WinJS应用程序打开PDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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