Getting Web-Server is not listening error and taking more than a minute to load the content in PDF Viewer

Hi All,

We are facing issues while loading the Base64Content into the PDF Viewer.

1) It taking more than a minute to load the document. Sometimes it will not load.
2) Sometimes getting the Web-Server is not listening error even though the document is loaded properly.
3) Sometimes after getting the Web-Server is not listening error document is not loading.


We have observed this issue Today(08/05/2020) in our application and online editors like stackblitz.

Could you please help us to resolve above issues.


Regards,
Subramanyam G

Attachment: Screenshots_78c2a8e4.zip

17 Replies 1 reply marked as answer

AA Akshaya Arivoli Syncfusion Team August 6, 2020 04:33 PM UTC

Hi Ravish, 

Thank you for your update. 

We are unable to reproduce the reported issue with the provided details. Please use both client and server side of same version. Also can you please try use of local web service project using the below link, 

    

Can you please share us the PDF document , base64 string, PDF document and the simple sample in which the issue could be reproduced. These details will be helpful for us to investigate further and assist you better. 


Regards,   
Akshaya  



RA Ravish August 17, 2020 08:44 AM UTC

Hi Team,

which you provided is for .NET Core 3.0 and above.

We are using the .NET Core 2.1 could you please provide the sample code which is supported to this version as soon as possible. 

Regards,
Ravish


AA Akshaya Arivoli Syncfusion Team August 18, 2020 09:29 AM UTC

Hi Ravish , 

Thank you for your update. 

Please refer to the below link to create PDF Viewer web service project in .NetCore 2.1, you can also find the sample at the end of the KB. 


Please revert us if you need further assistance.  

Regards, 
Akshaya  


Marked as answer

MJ Marvin Jay April 13, 2022 08:55 AM UTC

Hi SF Team,


I am experiencing the same issue. But with ASP.Net MVC.

Syncfusion version 19.4.0.52.


Here is a sample PDF. https://drive.google.com/drive/folders/1PYjTe6QfvhJStdBemrkuySMlghhf7V5F?usp=sharing


I hope someone could assist me on this. Thank you.


Regards,

Marvin


Attachment: PDFs_b8b7e374.zip



VS Vasugi Sivajothi Syncfusion Team April 13, 2022 01:44 PM UTC

Hi Marvin,


We were able to reproduce the reported issue with the provided document. We will analyze further on this and update you with more details on April 19, 2022.


Regards,

Vasugi.



VS Vasugi Sivajothi Syncfusion Team April 19, 2022 03:49 PM UTC

Hi Marvin,


We can resolve the reported issue by providing the maxAllowedContentLength and request length on the web. config file. And need to increase the maximum length for serializing the large-sized JSON object. So, we have created a class LargeJsonValueProviderFactory and modified the code to increase the length for serialization
in the file Global.asax.cs. Kindly refer to the below code snippet and sample.


Code Snippet:

 

<httpRuntime targetFramework="4.7.2" maxRequestLength="2147483647" executionTimeout="1600" requestLengthDiskThreshold="2147483647" />

 

<requestLimits maxAllowedContentLength="2147483647" />

 


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/GettingStarted_MVC2051814703


Kindly try this and let us know if this helps you.


Regards,

Vasugi



MJ Marvin Jay April 25, 2022 03:35 AM UTC

Hi Vasugi,


I'm using version 4.6.1 for framework. Is it okay or do I need to update it to 4.7.2 also?


Thank you.


Regards,

Marvin Al



MJ Marvin Jay April 25, 2022 06:43 AM UTC

Hi Vasugi,


I tried it with both versions  4.7.2 and 4.6.1. Also, I tried your sample app.

But only the figure 2 were able to load. The figure 2(1) didn't load.


https://drive.google.com/drive/folders/1PYjTe6QfvhJStdBemrkuySMlghhf7V5F the files here.


Were you able to try both files?


Thank you. Hoping fo


Regards,

Marvin Alfonso



SK Shamini Kiruba Sobers Syncfusion Team April 25, 2022 01:29 PM UTC

Hi Marvin,


It is okay to use the provided suggestion in the 4.6.1 framework. We have ensured the same in the following sample.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/GettingStarted_MVC-1631764041


Regards,

Shamini



MJ Marvin Jay April 26, 2022 03:34 AM UTC

Hi Shamini,


I tried both files again on your sample project but the figure 2(1) the 33Mb file is not loading.

"Web-service is not listening" error is showing.


Do you have idea why it's happening on my end?


Regards,

Marvin 



SK Shamini Kiruba Sobers Syncfusion Team April 26, 2022 08:32 AM UTC

Hi Marvin,


On further analysis, we have found that we have used the viewportHeight property in the jsonObjects class of the PdfViewerController file instead of using the viewPortHeight property. So the document was not rendered. Please refer to the below code snippet and modified sample for our reference.


Code Snippet:

public class jsonObjects 

    { 

……        

 public string viewPortHeight { getset; } 

 

} 


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/GettingStarted_MVC-914216573


However, the PDF file is still rendered as tiles instead of loading the entire document. We will validate this and let you know the details on April 28, 2022.


Regards,

Shamini



VS Vasugi Sivajothi Syncfusion Team April 29, 2022 02:49 AM UTC

Hi Marvin,


Currently, we are validating the reported issue, we will check further on this and provide further details on April 29, 2022.


Regards,

Vasugi.



VS Vasugi Sivajothi Syncfusion Team May 2, 2022 03:25 AM UTC

Hi Marvin,


We have used the tile rendering approach in our PDF Viewer control. If the page width is greater than the A4 size page, then we will split them into tiles and send the request for each tile and retrieve the data for the specific region. But we can also disable the tile rendering approach by setting enableTileRendering to FALSE in tileRenderingSettings API. Please refer to the below code snippet and documentation.

<div style="height:500px;width:100%;">

@Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("figure 2 (1).pdf").Created("created").Render()

</div>

<script>

    function created() {

        var viewer = document.getElementById('pdfviewer').ej2_instances[0];

        viewer.tileRenderingSettings.enableTileRendering = false;

    }

</script>


Documentation: https://ej2.syncfusion.com/documentation/api/pdfviewer/tileRenderingSettings/


However, we have improved the clarity of the image while rendering the PDF document. So, it will take time and memory to load the document. We have planned for converting the PDFIUM as a WASM library to achieve pure client rendering to improve the loading performance. The feature implementation will be included in any of our upcoming releases.


You can track the status using the below feedback link, 

https://www.syncfusion.com/feedback/25761/pdfium-source-web-assembly-implementation-for-client-side-rendering


Regards

Vasugi.




MJ Marvin Jay May 2, 2022 06:54 AM UTC

Hi Syncfusion team,


May I know what modifications did you make in  PdfViewerController?

In previous reply, you mentioned "we have found that we have used the viewportHeight property in the jsonObjects class of the PdfViewerController file instead of using the viewPortHeight property."


Regards,

Marvin



SK Shamini Kiruba Sobers Syncfusion Team May 3, 2022 08:00 AM UTC

Hi Marvin,


The sample provided in the below update has one of the properties in the jsonObjects class inside the PdfViewerController as “public string viewportHeight { get; set; }".

http://www.syncfusion.com/forums/156674/getting-web-server-is-not-listening-error-and-taking-more-than-a-minute-to-load-the-content?reply=Sgpibt


The property should be “public
string viewPortHeight { getset; }”. The change is only with the casing in the mentioned property as highlighted. Similarly, we have also changed for the viewPortWidth property in the PdfViewerController.cs file.


Regards,

Shamini



MJ Marvin Jay May 4, 2022 07:51 AM UTC

Hi Shamini,


Thank you. It's now working but there's another issue.


I tried to imitate this

"@Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("figure 2 (1).pdf").Created("created").Render()"


But I encountered an error: 

Uncaught ReferenceError: created is not defined


My Syncfusion version is 19.4.0.52


Regards,

Marvin



VS Vasugi Sivajothi Syncfusion Team May 6, 2022 04:15 AM UTC

Hi Marvin,


We have checked the reported issue with the provided version v19.4.0.52. But we were unable to reproduce it. We have shared the simple sample in which we have tried to reproduce the issue, please refer to the below link.

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/GETTIN~1-1125876219


Kindly try this and revert to us with a simple sample to replicate the reported issue on our end. This will be helpful to investigate further and provide the solution at the earliest.


Regards,

Vasugi



Loader.
Up arrow icon