590
Views
13
Comments
Solved
[Web Previewer] Inconsistent Document Loading
Question
Forge component by Rui Mendes
20
Published on 19 Nov 2018

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.

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: 

Rank: #24414

Hi, does removing the google part download the file to the local storage of the device?

mvp_badge
MVP
Rank: #15

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: 

Rank: #24414

Hi, does removing the google part download the file to the local storage of the device?

mvp_badge
MVP
Rank: #15

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. 


mvp_badge
MVP
Rank: #15

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

Regards,

Marcelo

WebPreviewer.oml

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

WebPreviewer_PDF_Link.oml

mvp_badge
MVP
Rank: #15

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

Rank: #41307

Hi there


Tried the same solution mentioned above , it now cannot really convert and render the file content properly in iframe . Do i have to do any other things too to make this work,


Regards

Kush

Rank: #41307

Hi there


Tried the same solution mentioned above , it now cannot really convert and render the file content properly in iframe . Do i have to do any other things too to make this work,


Regards

Kush

Rank: #6542

Kushagra Johri wrote:

Hi there


Tried the same solution mentioned above , it now cannot really convert and render the file content properly in iframe . Do i have to do any other things too to make this work,


Regards

Kush

 

You may check your Filename or FileType. Because in my case, I'm passing a wrong file type that's why the file is not rendering properly. 

Rank: #24414

Hi, this isn't an answer, but more of a question. I'm using this plugin but reading and writing the Binary File into the entity is causing timeouts on my app. Chrome's Dev Tools showed me that it takes about 30 seconds for each read and write. Is there some way to skip that part and simply view the file.

Like I'm already passing it in by means of a local variable, and the way it works now, is writing into the entity to create a cache for future use, and then using that cached version to display. How do I just display the file I'm passing in?