This is a migrated thread and some comments may be shown as answers.

NullReferenceException when using PdfViewer in an AddIn

3 Answers 30 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Fonger
Top achievements
Rank 1
Fonger asked on 21 Jan 2014, 08:13 AM

I try to use the PdfViewer in an addin (using the .net managed addin framework), hosted in a winform host application. When I open a pdf file I get this exception:

   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Utils.Helper.get_Dispatcher() in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Documents\Fixed\Core\FormatProviders\Pdf\Utils\Helper.cs:line 25

   at Telerik.Windows.Documents.Fixed.FixedDocumentStreamSource.<>c__DisplayClass8.<LoadDocument>b__6() in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Documents\Fixed\FixedDocumentViewers\Fixed\FixedDocumentStreamSource.cs:line 180

   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

   at System.Threading.ThreadHelper.ThreadStart()

I suspect the helper class is using Application.Current.Dispatcher. Application.Current is null in our environment.

Is there a work around for this problem so I can use the viewer in an addin?

Thank you,

Fonger.

3 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 23 Jan 2014, 03:43 PM
Hello Fonger,

Thank you for contacting us.

I would suggest reading this article which describes some common problems concerning RadPdfViewer, one of which is the problem you are having.

I hope this is helpful. Please, do not hesitate to contact us if you have any other questions.

Regards,
Alexander
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Fonger
Top achievements
Rank 1
answered on 24 Jan 2014, 06:38 AM

Hello Alexander,

Thanks for your reaction. I'm afraid your link isn't working (its just 'http:///'). Can you post it again?

Thanks,

Fonger.

0
Petya
Telerik team
answered on 24 Jan 2014, 08:33 AM
Hello Fonger,

Please follow this link: http://www.telerik.com/help/wpf/radpdfviewer-troubleshooting-common-problems.html.

Let us know if you have other questions.

Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
PDFViewer
Asked by
Fonger
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Fonger
Top achievements
Rank 1
Petya
Telerik team
Share this question
or