WPF GdViewer throws a NullReferenceException
WPF GdViewer throws a NullReferenceException
I'm having a problem where the new viewer is throwing a NullReferenceException when displaying a PDF. I attached the PDF in question to the post. The PDF is converted from a TIFF image and opens fine in all viewers, and it is converted by using GdPicture.
I can't really debug this because you obfuscate your code which makes it impossible to debug problems with your libraries. The method throwing the exception is the DisplayFromFile method.
this.gdPictureViewer.DisplayFromFile(this.SelectedDocument.FilePath);
Stack Trace:
at GdPicture11.WPF.GdViewer.gdpicture_ᜀ(Boolean A_0, Boolean A_1, Boolean A_2, Boolean A_3, Boolean A_4)
at GdPicture11.WPF.GdViewer.gdpicture_ᜀ(Boolean A_0, Boolean A_1, Boolean A_2, Boolean A_3, Double A_4, Double A_5, Boolean A_6, Boolean A_7, Boolean A_8, Boolean A_9, Boolean A_10, Boolean A_11)
at GdPicture11.Internal.Viewer.ViewerController.gdpicture_ᜀ(Boolean A_0, Boolean A_1, Boolean A_2, Boolean A_3, Boolean A_4, Boolean A_5, Boolean A_6, Boolean A_7, Boolean A_8, Boolean A_9, Boolean A_10, gdpicture_ A_11)
at GdPicture11.Internal.Viewer.ViewerController.gdpicture_ᜠ()
at GdPicture11.WPF.GdViewer.gdpicture_᜶()
at GdPicture11.WPF.GdViewer.()
at GdPicture11.WPF.GdViewer.DisplayFromFile(String FilePath)
at AccuSign.ViewModels.MainViewModel.SelectDocument(DocumentViewModel document) in f:\Capture Products\Code\AccuSign\AccuSign\ViewModels\MainViewModel.cs:line 1346
at AccuSign.ViewModels.MainViewModel.OnDocumentsLoaded() in f:\Capture Products\Code\AccuSign\AccuSign\ViewModels\MainViewModel.cs:line 975
at AccuSign.ViewModels.MainViewModel.LoadDocuments(IEnumerable`1 documents) in f:\Capture Products\Code\AccuSign\AccuSign\ViewModels\MainViewModel.cs:line 942
at AccuSign.App.InitializeDefaultViewState(MainWindowViewModel viewModel, IEnumerable`1 collection) in f:\Capture Products\Code\AccuSign\AccuSign\App.xaml.cs:line 147
at AccuSign.App.OnStartup(StartupEventArgs e) in f:\Capture Products\Code\AccuSign\AccuSign\App.xaml.cs:line 76
at System.Windows.Application.<.ctor>b__1(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
I can't really debug this because you obfuscate your code which makes it impossible to debug problems with your libraries. The method throwing the exception is the DisplayFromFile method.
this.gdPictureViewer.DisplayFromFile(this.SelectedDocument.FilePath);
Stack Trace:
at GdPicture11.WPF.GdViewer.gdpicture_ᜀ(Boolean A_0, Boolean A_1, Boolean A_2, Boolean A_3, Boolean A_4)
at GdPicture11.WPF.GdViewer.gdpicture_ᜀ(Boolean A_0, Boolean A_1, Boolean A_2, Boolean A_3, Double A_4, Double A_5, Boolean A_6, Boolean A_7, Boolean A_8, Boolean A_9, Boolean A_10, Boolean A_11)
at GdPicture11.Internal.Viewer.ViewerController.gdpicture_ᜀ(Boolean A_0, Boolean A_1, Boolean A_2, Boolean A_3, Boolean A_4, Boolean A_5, Boolean A_6, Boolean A_7, Boolean A_8, Boolean A_9, Boolean A_10, gdpicture_ A_11)
at GdPicture11.Internal.Viewer.ViewerController.gdpicture_ᜠ()
at GdPicture11.WPF.GdViewer.gdpicture_᜶()
at GdPicture11.WPF.GdViewer.()
at GdPicture11.WPF.GdViewer.DisplayFromFile(String FilePath)
at AccuSign.ViewModels.MainViewModel.SelectDocument(DocumentViewModel document) in f:\Capture Products\Code\AccuSign\AccuSign\ViewModels\MainViewModel.cs:line 1346
at AccuSign.ViewModels.MainViewModel.OnDocumentsLoaded() in f:\Capture Products\Code\AccuSign\AccuSign\ViewModels\MainViewModel.cs:line 975
at AccuSign.ViewModels.MainViewModel.LoadDocuments(IEnumerable`1 documents) in f:\Capture Products\Code\AccuSign\AccuSign\ViewModels\MainViewModel.cs:line 942
at AccuSign.App.InitializeDefaultViewState(MainWindowViewModel viewModel, IEnumerable`1 collection) in f:\Capture Products\Code\AccuSign\AccuSign\App.xaml.cs:line 147
at AccuSign.App.OnStartup(StartupEventArgs e) in f:\Capture Products\Code\AccuSign\AccuSign\App.xaml.cs:line 76
at System.Windows.Application.<.ctor>b__1(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
- Attachments
-
- test.zip
- (695.35 KiB) Downloaded 336 times
Re: WPF GdViewer throws a NullReferenceException
Hello,
The PDF can be perfectly opened and rendered using the latest version. Could you check you are up to date?
With best regards,
Loïc
The PDF can be perfectly opened and rendered using the latest version. Could you check you are up to date?
With best regards,
Loïc
Re: WPF GdViewer throws a NullReferenceException
I am on version 11.1.0.14.
Re: WPF GdViewer throws a NullReferenceException
OK. Please open a ticket on our helpdesk platform and we will send needed material to trace the issue: http://support.orpalis.com
With best regards,
Loïc
With best regards,
Loïc
Re: WPF GdViewer throws a NullReferenceException
It turned out that when using the MVVM pattern, you must ensure you are calling the view document api after the view has been fully initialized. In this case, the solution was the extract an interface from the view-model and call the view document api after the GdViewer has been fully loaded.
Who is online
Users browsing this forum: No registered users and 2 guests