Why are some documents not viewable

When things doesn't work as they should.
Post Reply
rgarcia
Posts: 7
Joined: Sat Sep 01, 2018 9:46 pm

Why are some documents not viewable

Post by rgarcia » Wed Oct 10, 2018 6:35 am

As shown in the attachment some documents are not shown correctly. Instead I get an red X.
However, when I download them everything works fine. So the files seems to be okay.
Attachments
Mayan-EDMS_DocView.png
Mayan-EDMS_DocView.png (237.13 KiB) Viewed 222 times

daniel1113
Posts: 14
Joined: Tue Aug 21, 2018 2:32 pm

Re: Why are some documents not viewable

Post by daniel1113 » Wed Oct 10, 2018 1:46 pm

I can confirm that this has been a common problem at least since 3.1.3. Reloading the page usually fixes it, but it's common enough that I expect to have a handful of previews missing any time I load a list of documents.

User avatar
rosarior
Posts: 159
Joined: Tue Aug 21, 2018 3:28 am

Re: Why are some documents not viewable

Post by rosarior » Wed Oct 10, 2018 4:50 pm

The combination of a missing preview and a page count of 0 means one of two things:
1- The PDF uploaded is in one of the formats not supported by the programs Mayan uses to introspect PDFs.
2- The background task that was introspecting the page count of the document after they finished uploading got interrupted (shutdown, system freeze).

You can verify which is the case by selecting the documents and choosing the action "Reclaculate page count" from the dropdown menu. If the PDF now show previews, the tasks were previously interrupted. If they still don't show a preview then it's the issue is with the format of the PDF itself. Give it a try.
Last edited by rosarior on Wed Oct 10, 2018 4:57 pm, edited 2 times in total.

mayanvic
Posts: 10
Joined: Thu Aug 23, 2018 4:27 pm

Re: Why are some documents not viewable

Post by mayanvic » Wed Oct 10, 2018 4:51 pm

This also happens on any password protected documents you import.

rgarcia
Posts: 7
Joined: Sat Sep 01, 2018 9:46 pm

Re: Why are some documents not viewable

Post by rgarcia » Wed Oct 10, 2018 5:31 pm

Alright easy - just figured out that if I open such a PDF in Adobe Reader DC and save it from there as copy of the failing document, it works :D

eriggs
Posts: 9
Joined: Fri Sep 07, 2018 3:32 am

Re: Why are some documents not viewable

Post by eriggs » Fri Oct 12, 2018 9:38 pm

daniel1113 wrote:
Wed Oct 10, 2018 1:46 pm
I can confirm that this has been a common problem at least since 3.1.3. Reloading the page usually fixes it, but it's common enough that I expect to have a handful of previews missing any time I load a list of documents.
Researching the topic we've found that the browser's .load() event doesn't behave the same way on all browsers when it comes to cached images. This only happens in some edge cases (which nobody has bothered to document). Chalk it up as another Javascript moronic design idea that everybody implements their own way.

https://api.jquery.com/load-event/
Caveats of the load event when used with images

A common challenge developers attempt to solve using the .load() shortcut is to execute a function when an image (or collection of images) have completely loaded. There are several known caveats with this that should be noted. These are:

It doesn't work consistently nor reliably cross-browser
It doesn't fire correctly in WebKit if the image src is set to the same src as before
It doesn't correctly bubble up the DOM tree
Can cease to fire for images that already live in the browser's cache
We've pushed a change that tries to determine if the image raises the error handler because of a real error or because of the weird .load() behavior and force the cached images to display correctly. The patch will be included in the next release.

Post Reply