Angular - Ngx Doc Viewer - Document displaying blank sometimes

1.2k Views Asked by At

I am using ngx-doc-viewer(Version 2.0.4) for previewing documents in my angular application. I am using google viewer. Its loading the documents fast but sometimes its not previewing the document and showing the blank content without any console errors.

Does anyone faced the similar issues. Please help me for the fixing this issue.

Thanks.

enter image description here

1

There are 1 best solutions below

1
On

Check the request in the network tab. Sometimes Google will return 204 - no content. This is a known issue. You can check out this stack overflow for some answers. Google Docs viewer returning 204 responses, no longer working, alternatives?

Ngx-doc-viewer provides some inputs that you could use to try to refresh the iframe. https://www.npmjs.com/package/ngx-doc-viewer

googleCheckContentLoaded = true | If true it will check by interval if the content is loaded.

googleCheckInterval = 3000 | The interval in milliseconds that is checked whether the iframe is loaded.

googleMaxChecks = 5 | max number of retries Output:

loaded: google only, notifies when iframe is loaded. Can be used to show progress while loading

In the meantime, perhaps you could open up a ticket for Google devs to take a look at. Hope this helps!