Overriding default PDFViewer error handling behaviour

We've successfully implemented the SfPdfViewer in our webassembly project. We would like to know how we can override the default error handling behaviour.

It's possible that the backend can not load the requested document or that an unexpected error occurred on the backend itself. Currently the PDF Viewer will show a default window stating `Web-service is not listening. PDF Viewer depends on web-service for all it's features. Please start the web service to continue.` We would like to change this behaviour and not show this message, but instead show a message of ourselves and act accordingly.

I was able to hook into the `AjaxRequestFailed`, but this does not seem to provide a way to stop the default behaviour.


4 Replies 1 reply marked as answer

VS Vasugi Sivajothi Syncfusion Team August 17, 2021 11:28 AM UTC

Hi Tom, 

Thank you for contacting Syncfusion support. 

You can suppress the dialog by using the EnableErrorDialog property. Please refer to the below code snippet and sample. 
 
Code Snippet: 

<SfPdfViewer @ref="PdfViewer" ServiceUrl=https://localhost:44399/pdfviewer  DocumentPath="@DocumentPath" EnableErrorDialog="false" Height="500px" Width="750px"> 
</SfPdfViewer> 



Kindly try this and let us know if you have any concerns about this. 

Regards, 
Vasugi. 


Marked as answer

TM Tom Matheussen August 18, 2021 07:49 AM UTC

Hi Vasugi,


Thank you very much, this works perfectly. You might want to consider adding this to the documentation.


Kind regards,

Tom



VS Vasugi Sivajothi Syncfusion Team August 19, 2021 03:13 PM UTC

Hi Tom, 
  
Sorry for the inconvenience. Currently, we are working on the documentation changes, we will update the details in the documentation and let you know once it is refreshed. 
  
Regards, 
Vasugi. 



VS Vasugi Sivajothi Syncfusion Team September 9, 2021 09:53 AM UTC

Hi Tom,  
 
 
We have refreshed the documentation for suppressing the error dialog. Kindly refer to the below link. 
 
 
 
Regards, 
Vasugi. 


Loader.
Up arrow icon