[Web Previewer] Inconsistent Document Loading

Forge Component
(18)
Published on 2018-11-19 by Rui Mendes
18 votes
Published on 2018-11-19 by Rui Mendes

I am experiencing an issue where the viewer occasionally does not load a document. The viewer does not provide any errors it simply just remains blank. 

The issue is difficult to reproduce on demand as it occurs randomly.The issue also occurs for a document which successfully loads on other occasions. 

Has anyone else experienced the same issue? If so, how did you overcome it? 

I am developing in Service Studio version 11.0.408.0.

Hi Nicholas,

I was having the same problem. Looks like docs.google.com/gview which is used has some problems and you need to keep reloading it till it works. basically i change the component a bit to stop using this and just open the file in an iframe.

Regards,

Marcelo 


Marcelo Ferreira wrote:

Hi Nicholas,

I was having the same problem. Looks like docs.google.com/gview which is used has some problems and you need to keep reloading it till it works. basically i change the component a bit to stop using this and just open the file in an iframe.

Regards,

Marcelo 


Hi Marcelo, 


Thank you for the feedback! 


I am not sure how the component could be changed to use an iframe, would you be willing to share an example? 


Thanks, 


Nicholas


Solution

As per Marcelo's suggested solution above, I managed find the location of the in the WebPreviewer Application which would bypass the Gviewer and display PDF's directly in the iframe. 

Change the Assign Expression variable in the preparation screen to NOT prepend the following code to the iframe src expression:

https://docs.google.com/gview?embedded=true&url=

Instead, remove the prepended code resulting in the following assignment: 

Solution

Hi,

Sry for the late response. Glad it's working for you.

Regards,

Marcelo

Marcelo Ferreira wrote:

Hi,

Sry for the late response. Glad it's working for you.

Regards,

Marcelo

No problem! Thanks for the help. 


I will include here my solution if anyone else has the same problem.

Regards,

Marcelo

Thanks for the example Marcelo. 

I noticed that the ability to open up a .pdf into a new tab is lost when moving to an iframe. 

The attached example has a link which displays at the bottom of the viewer when a .pdf is rendered. The link will open up a new tab and display the .pdf.

Perhaps this will assist someone else who also requires .pdf's to be opened in a new tab. 

Kind regards, 

Nicholas

Hi NIcholas,

I also have that functionality of sometimes open the file in same page , another page or even popup. But i prefer to have it outside the component. Basically I have a page with the preview. and depending on the way I open that page I have the 3 different behaviors.

Regards,

Marcelo