[]
To open an existing PDF file you can use the LoadDocument method by passing a stream to the file. To open a file selected by the user, complete the following code:
Dim openPicker As New FileOpenPicker()
openPicker.FileTypeFilter.Add(".pdf")
Dim file As StorageFile = Await openPicker.PickSingleFileAsync()
If file IsNot Nothing Then
Dim stream As Stream = Await file.OpenStreamForReadAsync()
pdfViewer.LoadDocument(stream)
End If
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.FileTypeFilter.Add(".pdf");
StorageFile file = await openPicker.PickSingleFileAsync();
if (file != null)
{
Stream stream = await file.OpenStreamForReadAsync();
pdfViewer.LoadDocument(stream);
}
Task-Based Help