WebService Error

I sporadically get the error 'Web-service is not listening. PDF Viewer depends on web-service for all it's features. Please start the web-service to continue.' and all information is lost. I am using SfPdfViewer2 in a Blazor Server web app and my understanding is that this does not require a webservice. I have checked that I do not have any conflicting packages installed, so I am at a loss as to why this should occur. I mention also that the app uses custom annotations to add controls to a pdf. I got told that for more advanced issues beyond basic loading and displaying the pdf, the viewer does, in fact, use a web-service, which I cannot get confirmed. Can this error be due to internet connectivity loss, as I am still using localhost for testing? My biggest concern is that I will have many contiguous connections to the app and I cannot afford caching errors, as mentioned in this allied (but older) article: https://blazor.syncfusion.com/documentation/pdfviewer/how-to/webservice-not-listening


5 Replies

SK Sathiyaseelan Kannigaraj Syncfusion Team November 18, 2024 12:28 PM UTC

Hi Philip,

Thank you for reaching out. As the `SfPdfViewer2` does not require a web service to load PDFs into the viewer, it renders entirely on the client side, so this issue should not occur. We have included a sample that we tested; please review it and confirm if the issue persists. If you are still encountering any problems, kindly provide a sample and demo to help us replicate the issue and offer a solution.

SfPdfViewer 2 Sample
 


Regards,
Sathiyaseelan K



PH Philip November 18, 2024 04:45 PM UTC

I am using Syncfusion pdf to add the controls to the pdf. Does that utilise a webservice, or is that also totally independent?



SK Sathiyaseelan Kannigaraj Syncfusion Team November 19, 2024 08:48 AM UTC

Hi Philip,

Thank you for the update. Could you please provide more details about the issue you are encountering, as it is not entirely clear. If possible, kindly share a sample or a demo video of the issue to help us analyze and provide a solution. Additionally, please confirm whether you are trying to add annotations using the PDF library and encountering this issue.


Regards,
Sathiyaseelan K



PH Philip November 19, 2024 11:33 AM UTC

Due to confidentiality constraints, I am unable to provide the actual code. However, the process is as follows: a menu button is clicked, triggering a custom stamp (annotation) on the sfPdfViewer. This stamp captures the mouse click coordinates, and a Syncfusion PDF class is then invoked to add the desired control to the PDF stream at these coords. The updated stream is subsequently used to refresh the viewer. This workflow typically functions flawlessly and can be repeated multiple times without any issues—until a warning screen occasionally appears (as shown in the example below).

The challenge lies in the intermittent nature of the error, which occurs unpredictably. I also notice that at times, clicking "OK" on the warning screen restores the page to normal, while other times it completely clears the PDF from the viewer. Efforts to trace any network issues have been unsuccessful. However, if neither the viewer nor the Syncfusion PDF component communicates with a web service, such results might be expected. Conversely, if this is the case then why would a web-service error appear?

I checked to ensure that there is no earlier version of the Syncfusion Viewer installed. The version being used is SfPdfViewer 27.1.58 and Syncfusion PDF.Net.Core 27.1.58 running on .Net8 in a Blazor application.

Image_6934_1732013977117



SK Sathiyaseelan Kannigaraj Syncfusion Team November 20, 2024 12:46 PM UTC

Hi Philip,

Thank you for the update. We also attempted adding a custom stamp to specific locations on PDF pages when a page is clicked, and the issue did not occur. Below, we have provided the sample we tested. Kindly review the sample to confirm whether the issue persists. If you do not encounter any issues, please modify the sample using the provided instructions to resolve the problem. If the issue still occurs, adjust the sample we shared to replicate it. Additionally, the PDF Viewer supports adding annotations programmatically. We have included documentation and a sample for adding annotations programmatically below.

Sample with Add Stamp


Sample Adding Stamp Programmatically


Documentation Adding Stamp Programmatically
 


Regards,
Sathiyaseelan K


Loader.
Up arrow icon