【发布时间】:2017-08-31 19:24:42
【问题描述】:
我正在用 javascript 编写 UWP 应用。
其中包含一个链接列表,每个链接都称为 PDF。
PDF 存储在本地应用程序中。
目标是为 Hololens (Windows AR) 提供一个免提文档库
无论如何,我打开 PDF:
Windows.System.Launcher.launchFileAsync(file)
这一切都很好。
然而,PDF 也通过超链接相互引用。
我可以将超链接修改为最初生成 PDF 时的任何内容。
但是我怎样才能使超链接在用户的默认 PDF 应用程序中打开时仍能相互引用。
同样,默认的 PDF 应用程序可以是任何东西。
这在适用于 Windows 的 Adobe Acobat 中运行良好,
希望将此功能移植到 UWP。
当前代码和工作:
window.onload = function () {
document.getElementById("#id").onclick = function (evt) {
pdfopen("pdf.pdf")
}
function pdfopen(pdf) {
var imageFile = "assets\\" + pdf;
// Get the image file from the package's image directory
Windows.ApplicationModel.Package.current.installedLocation.getFileAsync(imageFile).then(
function (file) {
// Launch the retrieved file using the default app
var options = new Windows.System.LauncherOptions();
Windows.System.Launcher.launchFileAsync(file)
}
);
提前感谢任何帮助
【问题讨论】:
标签: javascript pdf hyperlink uwp hololens