如何阅读Windows 8应用程序中的pdf文件。在我的Windows 8应用程序中如何打开PDF文件。如何在Windows 8应用程序中使用c#打开pdf文件?
在清单文件中,我写了下面的代码。
<Extensions>
<Extension Category="windows.fileTypeAssociation">
<FileTypeAssociation Name="pdf">
<SupportedFileTypes>
<FileType>.pdf</FileType>
</SupportedFileTypes>
</FileTypeAssociation>
</Extension>
</Extensions>
和后面的代码。
string imageFile = @"Images\DX730_EN.pdf";
var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(imageFile);
if (file != null)
{
// Set the option to show the picker
var options = new Windows.System.LauncherOptions();
options.DisplayApplicationPicker = true;
// Launch the retrieved file
bool success = await Windows.System.Launcher.LaunchFileAsync(file, options);
if (success)
{
// File launched
}
else
{
// File launch failed
}
}
else
{
// Could not find file
}
我无法打开PDF文件。请告诉我错误在哪里?
代码如何打开pdf文件? – user1727822
哪种语言? –
在Windows 8应用程序中,我需要打开PDF文件使用C#。请让我知道。 – user1727822