I've tried to create simple demo application with Pdf Viewer control, MVVM style via ItemSource binding, document successfully loaded, but application crashes every time I try to resize main window.
werControl>
cs:
publicStreamDocumentStream
{
get{return_pdfFileStream; }
set
{
_pdfFileStream =value;
RaisePropertyChanged(() => DocumentStream);
}
}
private void LoadFile() {
Assemblyassembly =typeof(MainPage).GetTypeInfo().Assembly;
DocumentStream= assembly.GetManifestResourceStream("App2.Assets.Windows Store Apps Succinctly.pdf");
}
stacktrace:
value cannot be null. Parameter name: crossTable
at 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.SfPdfViewerControl.LoadDocument(PdfLoadedDocument loadedDocument)
at Syncfusion.Windows.PdfViewer.SfPdfViewerControl.<SfPdfViewerControl_SizeChanged>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()
p.s.no crash if I loaded through PdfLoadedDocument ldoc and call pdf.LoadDocument(ldoc);