App Crash when moving window between screen while document is loading
I have two monitors, both with a different scaling factor applied. If I move an application between monitors that has a pdf viewer in it that is momentarily loading a pdf document the app crashes with this exception:
System.ArgumentOutOfRangeException
"Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index"
` at System.ThrowHelper.ThrowArgumentOutOfRange_IndexException() in E:\A\_work\159\s\src\mscorlib\src\System\ThrowHelper.cs:line 80
at Syncfusion.Windows.PdfViewer.SfPdfViewerControl.ChangeZoomFactorOnResizing()
at Syncfusion.Windows.PdfViewer.SfPdfViewerControl.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in E:\A\_work\159\s\src\mscorlib\src\System\Runtime\ExceptionServices\ExceptionDispatchInfo.cs:line 132
at System.Threading.WinRTSynchronizationContextBase.Invoker.InvokeCore() in C:\A\1\8\s\corefx\src\System.Runtime.WindowsRuntime\src\System\Threading\WindowsRuntimeSynchronizationContext.cs:line 213`
Hello
going from your sample please do the following two things:
- upgrade to latest version of Syncfusion v19.2.x
- do the following code changes:
<Grid x:Name="pdfViewerGrid" Grid.Row="1"> <cc:SfPdfViewerControl x:Name="pdfViewer" /> </Grid> <Border x:Name="PdfRoot" Grid.Row="1" />
private SfPdfViewerControl CreateNewPdfViewer() { var viewer = new SfPdfViewerControl(); viewer.ViewMode = PageViewMode.FitWidth; PdfRoot.Child = viewer; return viewer; }
var viewer = CreateNewPdfViewer(); PdfRoot.Child = viewer; await viewer.LoadDocumentAsync(ldoc);
//pdfViewer.LoadDocument(ldoc);
For repro:
Regards,
Vikram
We were still unable to reproduce the reported issue, “Application crashes with argument exception when moving window between screen while document is loading” with the provided information.
Please follow this Incident ID for this same issue: https://www.syncfusion.com/support/directtrac/incidents/341667
- 4 Replies
- 3 Participants
-
ED E Doust
- Aug 25, 2021 09:48 AM UTC
- Sep 6, 2021 10:56 AM UTC