如何閱讀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