[英]Reading PDF files using Adobe or any PDF reader
在我的应用程序中,我将所有PDF都放在名为PDF
的文件夹中,其名称类似于First.pdf
, First.pdf
Second.pdf.
我有LongListSelector
, LongListSelector
有一些项目。 当我点击每个项目时,我将所选项目值存储在一个字符串中。
private void longListSelector_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
MyObject item = longListSelector.SelectedItem as MyObject;
MessageBox.Show(item.ST);
}
上面的代码给出了像First
, Second
这样的名字。
现在我只想打开具有该名称的相应pdf文件。
编辑
我正在使用Windows Phone 8应用程序,PDF在我的应用程序内的MyPdf
文件夹中。
**编辑1 **
private async void LaunchPDF(string name)
{
StorageFile pdfFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("xyz.pdf");
// Launch the pdf file.
Windows.System.Launcher.LaunchFileAsync(name);
}
在此行中获取错误Windows.System.Launcher.LaunchFileAsync(name); //包含无效参数。
我可以使用My Emulator
来测试pdf是否打开?
您可以使用此组件: PdfViewer ,但该组件不是开源的。
假设该应用程序正在针对Windows Phone OS 8开发。
您可以使用启动器打开它。
// Get the file
StorageFile pdfFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("xyz.pdf");
// Launch the pdf file.
Windows.System.Launcher.LaunchFileAsync(xyz.pdf);
关于URI启动器的链接
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.