We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PDF Viewer Service (asp.net core 3.0): Syncfusion.EJ2.PdfViewer.Load returns "Object reference not set to an instance of an object."

Thread ID:

Created:

Updated:

Platform:

Replies:

148160 Oct 8,2019 03:10 PM UTC Jan 2,2020 07:35 AM UTC Angular - EJ 2 7
loading
Tags: PDF Viewer
Manuel Naujoks
Asked On October 8, 2019 03:10 PM UTC

Hi.

I am trying to get the <ejs-pdfviewer> working. It works with your backend but now I am struggling with creating my own PDF Viewer Service. I took the code from here (https://ej2.syncfusion.com/documentation/pdfviewer/how-to/create-pdfviewer-service/) and use it in a ASP.NET Core 3.0 WebApi project.
However, when my Angular SPA attempts to load the document, Syncfusion.EJ2.PdfViewer.Load returns "Object reference not set to an instance of an object." instead of a real JSON object:



What can I do to successfully serve my PDF to the SPA?


Kindest regards
Manuel

Attachment: DMS2209.Backend_f6808d77.zip

Akshaya Arivoli [Syncfusion]
Replied On October 9, 2019 09:42 AM UTC

Hi Manuel , 

Thank you for contacting Syncfusion support. 

We have analyzed the provided details and found that you are using the ASP.NET MVC code snippet in .Net Core project. Please find the below KB to create the PDF Viewer Web service project in ASP.NET Core  


We have also created the sample for the same and shared in the following location, 


Please try this and revert us with more details and modified sample if you are still facing the issue. These details will be helpful for us to investigate more on your issue and assist you better. 

Regards, 
Akshaya 


Sandeep
Replied On October 24, 2019 12:18 PM UTC

Hi, I am using Angular 8, API is working fine but pdf always showing loading spin. 

Akshaya Arivoli [Syncfusion]
Replied On October 25, 2019 10:45 AM UTC

Hi Sandeep,
Based on the provide details we suspect that the reported error occured due to any of the following reasons, 
  • Script and NuGet of different version might be referred, if so kindly use both the Scripts (@syncfusion/ej2-angular-pdfviewer) and the NuGet packages of same version in your project to avoid conflicts.
  • Script error may be thrown so the PDF document is not rendered, if so please provide the error details
  • Provided document may not be available in the location specified in GetDocumentPath()
We have also created simple PDF Viewer sample and shared in the below location, 



Please try this and revert us with the error details, modified sample, replication procedure and Syncfusion version, if you are still facing the issue. These details will be helpful for us to investigate more on your issue and assist you batter. 

Regards, 
Akshaya 


Thejas p
Replied On December 24, 2019 12:14 PM UTC

i am aslo facing same problem in mvc  please help me

Akshaya Arivoli [Syncfusion]
Replied On December 30, 2019 12:34 PM UTC

Hi Thejas, 

Thank you for using Syncfusion products. 

We are unable to reproduce the reported issue with the provided details. We have created simple PDF Viewer sample in MVC and shared the same in the following location,  


Please try this and revert us with more details about your issue, Essential Studio version and modified sample if you are still facing the issue. These details will be helpful for us to investigate further and assist you better. 

Regards, 
Akshaya 


Thejas p
Replied On January 1, 2020 07:13 AM UTC

Hi its working fine now.but pdf form filling is not working in your sample project .when i fill all text box of pdf form  and i am getting empty pdf form not filled one when i downloaded, can u help me please.

Akshaya Arivoli [Syncfusion]
Replied On January 2, 2020 07:35 AM UTC

Hi Thejas, 

Sorry for the inconvenience caused. Json objects to download the form fields were not included in the provided sample, so the form fields are not preserved during downloading. We have updated the Controller code and shared the modified sample in the below link, 


Please try this and revert us with the more details and modified sample if you still have any concerns on this. 

Regards, 
Akshaya 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon