BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
StorageFile file = await ApplicationData.Current.LocalFolder.GetFileAsync(filename);
var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
Stream fileStream = stream.AsStreamForRead();
pdfViewer.LoadDocument(fileStream);
var picker = new FileOpenPicker();
picker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
picker.ViewMode = PickerViewMode.List;
picker.FileTypeFilter.Add(".pdf");
var file = await picker.PickSingleFileAsync();
if (file == null) return;
var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
Stream fileStream = stream.AsStreamForRead();
pdfViewer.LoadDocument(fileStream);
Hi Kurt,
Thank you
for using Syncfusion products.
We are not
able to reproduce the issue mentioned. We maintain separate implementation of
PDF Viewer for .Net framework 4.5 (Windows 8) and for .Net framework 4.5.1 (Windows
8.1). The PDF viewer for Windows 8.1 cannot be deployed to a machine with
Windows 8, since it does not support .Net framework 4.5.1. Kindly find the
below sample for deploying the PDF Viewer in different operating systems.
Sample for
Windows 8: http://www.syncfusion.com/downloads/support/directtrac/general/PDFViewerWintRT_2012672990118.zip
Sample for
Windows 8.1: http://www.syncfusion.com/downloads/support/directtrac/general/PDFViewerWintRT_201363968850.zip
Assemblies
to run the sample for Windows 8 will be available in the location
$SystemDrive:\Users\$UserName$\AppData\Local\Syncfusion\EssentialStudio\12.1.0.43\WinRT\SampleBrowser\Common\Common\DirectXAssembly\8.0
Assemblies
to run the sample for Windows 8 will be available in the location
$SystemDrive:\Program
Files (x86)\Syncfusion\Essential Studio\ 12.1.0.43\Assemblies for WinRT\8.1
Note: In above
location for finding the assemblies version is Essential studio is assumed to
be 12.1.0.43.
Please let
us know if you need any further assistance.
Thanks,
Suresh
Hi,I've followed the examples, and tried with 2 different PDF files (attached).I've used the following code:StorageFile file = await ApplicationData.Current.LocalFolder.GetFileAsync(filename);
var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
Stream fileStream = stream.AsStreamForRead();
pdfViewer.LoadDocument(fileStream);
Based on the following code:var picker = new FileOpenPicker();
picker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
picker.ViewMode = PickerViewMode.List;
picker.FileTypeFilter.Add(".pdf");
var file = await picker.PickSingleFileAsync();
if (file == null) return;
var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
Stream fileStream = stream.AsStreamForRead();
pdfViewer.LoadDocument(fileStream);
Taken from:http://help.syncfusion.com/UG/winrt/default.htm#!Documents/viewingpdf.htmAnd get the following exception:System.ArgumentNullExceptionat Syncfusion.Pdf.Parsing.PdfLoadedPageCollection..ctor(PdfDocumentBase document, PdfCrossTable crossTable)at Syncfusion.Pdf.Parsing.PdfLoadedDocument.get_Pages()at Syncfusion.Pdf.Parsing.PdfLoadedDocument.get_PageCount()at Syncfusion.Windows.PdfViewer.PdfDocumentView.set_LoadedDocument(PdfLoadedDocument value)at Syncfusion.Windows.PdfViewer.SfPdfViewerControl.LoadDocument(PdfLoadedDocument loadedDocument)at Syncfusion.Windows.PdfViewer.SfPdfViewerControl.SfPdfViewerControl_SizeChanged(Object sender, SizeChangedEventArgs e)The file object references the correct file, and the fileStream has a valid length. I'm using the same code to load and manipulate files from local storage elsewhere within my application so I can't see that being the problem. Are there some default values that I need to set on the pdfViewer control?
Attachment: Sample_PDFs_e460c498.zip