[Mayan EDMS: 1659] PDF document blank after upload

classic Classic list List threaded Threaded
6 messages Options
Ben
Reply | Threaded
Open this post in threaded view
|

[Mayan EDMS: 1659] PDF document blank after upload

Ben
Hi,
I have just set up Mayan in a virtual environment according this guide (http://mayan.readthedocs.io/en/latest/topics/deploying.html). Everything works fine, except that some pdf documents I am uploading are empty. No thumbnail (red question mark ), no preview, the property of the document shows pages: 0. But the pdf is in the media folder, I am able to open it from there.

Any ideas?
Ben

--

---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

[Mayan EDMS: 1660] Re: PDF document blank after upload

MacRobb Simpson
Just out of curiosity, what does "pdfinfo *pdf file*" say about your 'broken' files vs a 'normal' one?
Does the broken ones say they are encrypted perhaps?

On Tuesday, April 25, 2017 at 3:25:45 AM UTC-7, Ben wrote:
Hi,
I have just set up Mayan in a virtual environment according this guide (<a href="http://mayan.readthedocs.io/en/latest/topics/deploying.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmayan.readthedocs.io%2Fen%2Flatest%2Ftopics%2Fdeploying.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNECGc2MuIEwQ8EsclUTOkGE7SWd6g&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmayan.readthedocs.io%2Fen%2Flatest%2Ftopics%2Fdeploying.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNECGc2MuIEwQ8EsclUTOkGE7SWd6g&#39;;return true;">http://mayan.readthedocs.io/en/latest/topics/deploying.html). Everything works fine, except that some pdf documents I am uploading are empty. No thumbnail (red question mark ), no preview, the property of the document shows pages: 0. But the pdf is in the media folder, I am able to open it from there.

Any ideas?
Ben

--

---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Ben
Reply | Threaded
Open this post in threaded view
|

[Mayan EDMS: 1661] Re: PDF document blank after upload

Ben
Indeed they are! They were produced with different tools, have different versions ( 1.3 - 1.7 ) but the correct ones are all not encrypted, the blank ones are all encrypted.
I removed the encryption, uploaded the file again and it's working now.

At the moment i'm only testing with ebook files, but how can I handle encrypted pdf documents in a company? They are not password protected, so that a document might be encrypted is for a normal user not obvious.

What part of Mayan cannot handle encrypted pdfs? Is there any workaround?

On Tuesday, 25 April 2017 18:06:47 UTC+2, MacRobb Simpson wrote:
Just out of curiosity, what does "pdfinfo *pdf file*" say about your 'broken' files vs a 'normal' one?
Does the broken ones say they are encrypted perhaps?

On Tuesday, April 25, 2017 at 3:25:45 AM UTC-7, Ben wrote:
Hi,
I have just set up Mayan in a virtual environment according this guide (<a href="http://mayan.readthedocs.io/en/latest/topics/deploying.html" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmayan.readthedocs.io%2Fen%2Flatest%2Ftopics%2Fdeploying.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNECGc2MuIEwQ8EsclUTOkGE7SWd6g&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmayan.readthedocs.io%2Fen%2Flatest%2Ftopics%2Fdeploying.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNECGc2MuIEwQ8EsclUTOkGE7SWd6g&#39;;return true;">http://mayan.readthedocs.io/en/latest/topics/deploying.html). Everything works fine, except that some pdf documents I am uploading are empty. No thumbnail (red question mark ), no preview, the property of the document shows pages: 0. But the pdf is in the media folder, I am able to open it from there.

Any ideas?
Ben

--

---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

[Mayan EDMS: 1662] Re: PDF document blank after upload

MacRobb Simpson


What part of Mayan cannot handle encrypted pdfs? Is there any workaround?
Internally, it uses pdftotext and pdftoppm

 
At the moment i'm only testing with ebook files, but how can I handle encrypted pdf documents in a company? They are not password protected, so that a document might be encrypted is for a normal user not obvious.
Um... From my own testing, you have to have a password to encrypt it, at least an owner password.
If you know the password, pdftoppm can be given it with a  '-opw' command line option(which would have to be edited into the correct area of Mayan code).
Alternately, pdftk can do this.
You might be able to replace the call to 'pdftoppm *file*' to 'pdftk *file* output - allow AllFeatures | pdftoppm' or something like this.
(looks like a lot of the code is in apps/converter/backends/python.py
You might also end up writing a little shell script that does this replacement, and use that as the path to pdftoppm, or something like this.

Alternately, if you feel comfortable editing the code, modify that backend to where it tries to do it with just pdftoppm, if that fails, then use pdftk to strip it first.
This would provide the best balance of speed and capability.

--

---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Ben
Reply | Threaded
Open this post in threaded view
|

[Mayan EDMS: 1663] Re: PDF document blank after upload

Ben
Thank you  for yor help. Seems I need to study the code a bit.

The weird thing is: The PDF doesn't ask for a password.( I think it was downloaded somewhere ) I can open it and I could convert it by printing it through a PDF to file printer to get rid of the encryption.
I will deploy Mayan some day in a law firm, I 'm working for for several years. They don't create any password protected PDFs there but get a lot PDFs by mail.
So I definitely need some way to detect encrypted PDF.

On Tuesday, 25 April 2017 21:15:39 UTC+2, MacRobb Simpson wrote:


What part of Mayan cannot handle encrypted pdfs? Is there any workaround?
Internally, it uses pdftotext and pdftoppm

 
At the moment i'm only testing with ebook files, but how can I handle encrypted pdf documents in a company? They are not password protected, so that a document might be encrypted is for a normal user not obvious.
Um... From my own testing, you have to have a password to encrypt it, at least an owner password.
If you know the password, pdftoppm can be given it with a  '-opw' command line option(which would have to be edited into the correct area of Mayan code).
Alternately, pdftk can do this.
You might be able to replace the call to 'pdftoppm *file*' to 'pdftk *file* output - allow AllFeatures | pdftoppm' or something like this.
(looks like a lot of the code is in apps/converter/backends/python.py
You might also end up writing a little shell script that does this replacement, and use that as the path to pdftoppm, or something like this.

Alternately, if you feel comfortable editing the code, modify that backend to where it tries to do it with just pdftoppm, if that fails, then use pdftk to strip it first.
This would provide the best balance of speed and capability.

--

---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

[Mayan EDMS: 1664] Re: PDF document blank after upload

MacRobb Simpson
pdfinfo does it.



On Tuesday, April 25, 2017 at 1:29:22 PM UTC-7, Ben wrote:
Thank you  for yor help. Seems I need to study the code a bit.

The weird thing is: The PDF doesn't ask for a password.( I think it was downloaded somewhere ) I can open it and I could convert it by printing it through a PDF to file printer to get rid of the encryption.
I will deploy Mayan some day in a law firm, I 'm working for for several years. They don't create any password protected PDFs there but get a lot PDFs by mail.
So I definitely need some way to detect encrypted PDF.
pdfinfo will do it, so if you need to 'detect' it(from a terminal), you can do "pdfinfo | grep 'Encrypted' "

Also, like I said, pdftk will strip out the encryption(and DRM-restrictions) easily.

As far as being able to open it/print it:
Firefox's built in PDF viewer ignores all restrictions.
Other browsers and clients tend to follow the DRM restrictions - Chrome, Internet Explorer, Edge, Adobe, SumatraPDF etc.
A few - Okular on KDE/Linux, for instance - have an option in the settings as to whether to ignore the restrictions or not.

If a user password is set, it actually encrypts the file and prevents access without it.
If a user password is *not* set, the restrictions that can be set involve copying or printing... and it depends on whether or not the client 'follows' the restrictions.

--

---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.