Hi Maxim,

"exiftool -a" works for dox, odt and pdf.

exiftool -a test.pdf | grep 'Page Count' | awk '{print $4}'
exiftool -a test.odt | grep 'Document-statistic Page-count' | awk
'{print $4}'
exiftool -a test.docx | grep Pages | awk '{print $2}'

Greetings Peter

Am 19.06.19 um 09:33 schrieb Maxim Solodovnik:
> Hello Denis,
>
> I'll keep this letter to do some investigations/improvements :)
>
> First lat me explain how document conversion works:
> 1) file being uploaded is checked to be "office document" (txt, doc,
> xls, pdf etc.)
> 2) then file is converted to PDF using libre/open-office (if it is NOT
> PDF already)
> 3) then each page of PDF is being saved as PNG using imagemagic
>
> each step is atomic operation :(
> I can try to check if it is possible to know the number of pages using
> command line (not sure yet how :(( )
>
> Convertion process can be improved IF we can find good alternative to
> the above 3rd party tools
> (for ex. cross-platform virtual printer able to print to PNG files
> from command line :))))
>
> On Sun, 16 Jun 2019 at 01:27, Denis Noctor <denisnoc...@gmail.com
> <mailto:denisnoc...@gmail.com>> wrote:
>
>     Apologies Maxim for the late reply, I increased the amount of RAM
>     on my AWS instance and this has addressed the problem. I am a
>     little bit surprised how much RAM is used for the conversion
>     processes though.
>
>     I was, however, able to replicate the upload conversion
>     problem.... but under extreme circumstances on the
>     *https://om.alteametasoft.com:8443/next* platform -  I
>     accidentally tried to upload a PDF file (a small file  - about 1.5
>     megs... but it has a LOT of pages, over 600!!!!!!... mainly text)
>     - I know, I know and I'm sorry :) I should have checked it first
>     before uploading as the chances of anyone doing this are zero...
>     but it led me to think....
>
>     When I previously tried to upload documents (with low RAM),
>     everything seemed to "hang" on continuously converting... with no
>     error message (presumably as everything is being dealt with
>     separately by ImageMajick)... and nothing can be seen except by
>     digging into the logs. The only way to stop the process was to
>     cancel and exit the room... sometimes resulting in an "internal
>     error". Would it be possible to add something such as setting
>     additional limitations" (for example on the admin/configuration
>     page) similar as to limiting file size upload, PDF conversion
>     quality and so on..... but restricting how many pages are to be
>     converted when uploading a doc, ppt and pdf file ? 
>
>     For example, if a user uploads a document of more than 10 pages to
>     be converted.... that they are prompted with a message to say that
>     documents of "x" pages or less can be only converted - please try
>     again" - 
>
>     I think this would be extremely beneficial to the non-suspecting
>     user who tries to upload a file with too many pages and does not
>     know what is happening as a result --- of worse - crashes the
>     platform. Hope this is of some use.
>
>     All the best,
>
>     Denis.
>     (I would be happy to email ou a copy of the file I was using
>     directly as I can't put it out on the public domain),
>
>
>
>
>     
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
>       Virus-free. www.avg.com
>     
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
>
>
>
>     On Wed, Jun 5, 2019 at 11:25 PM Maxim Solodovnik
>     <solomax...@gmail.com <mailto:solomax...@gmail.com>> wrote:
>
>         Do you have any errors in the logs?
>         can you check with PS which processes are started?
>
>         Actually conversion is made by running 3rd party tools
>         (imagemagic, libreoffice etc.) 
>         and there is configurable
>         timeout external.process.ttl 
> https://openmeetings.apache.org/GeneralConfiguration.html so
>         processes will not work "forever"
>
>         I can suggest to:
>         1) using real-time logs find the process which hangs
>         2) try to to manually run it, maybe play with some params
>
>         I never saw the behavior like this :(
>
>         On Mon, 3 Jun 2019 at 23:27, Denis Noctor
>         <denisnoc...@gmail.com <mailto:denisnoc...@gmail.com>> wrote:
>
>             Hi there Maxim,
>
>             I am running 2 different AWS instances (both with Ubunto
>             18.04.2 LTS) – the only difference being is that one is
>             running  5.0.0-M2-SNAPSHOT (Revision - 85daa3b /Build date
>             2019-05-13T16:53:23Z) and the other is running
>             5.0.0-M2-SNAPSHOT (Revision - 1c16b6d /Build date
>             2019-05-19T13:29:29Z)
>
>             The first one is setup using  NUMB TURNSERVER and as a
>             result audio and video is working as expected (solving the
>             whole NAT issue I had some time back).
>             Both installations are based on Alvaro’s version 9
>             instructions “Installation of Apache OpenMeetings 5.0.0 M1
>             on Ubuntu 18.04 LTS” … with the exception of installing
>             the 5.0.0-M2-SNAPSHOTS… on Ubunto 18.04.2 LTS.
>             When I try upload files to “My Files” / the whiteboard,
>             everything seems to “hang” on the “Converting…” pop up
>             stage. When I press “cancel” in the pop up box, the box
>             closes though there still appears be some activity in the
>             background as there is still a “spinning” arrow. When I
>             exit the room sometimes get an “Internal Error – Return to
>             home page”
>             
> (https://........./openmeetings/wicket/bookmarkable/org.apache.wicket.markup.html.pages.InternalErrorPage)
>
>
>             This is why I set up a second AWS instance to double check
>             installation – however, in the second installation I have
>             the same “converting” issues.
>
>             However, sometimes if I reboot the instances, restarting
>             MySql, Kurento and Tomcat3 (in this order), I can
>             sometimes upload _ONE_ document (jpg, ppt, doc etc.) but
>             when I try to upload another file, everything is stuck on
>             the “converting” process until I cancel.
>
>             I am curious to know if there are other users using Ubuntu
>             18.04.2 LTS (AWS instance) and if they are having a
>             similar problem as I am beginning to think this is unique
>             to 18.04.2 LTS (and not 18.04).
>             For reference the following are installed:
>             ImageMagick - Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114
>             Ghostscript – Version: GPL Ghostscript 9.26 (2018-11-20)
>             LibreOffice  - Version: 6.2.4.2 20(Build:2)
>
>             /etc/ImageMagick-6/policy.xml has been edited to comment
>             out the following:
>             <!-- <policy domain="coder" rights="none" pattern="PS" /> -->
>             <!-- <policy domain="coder" rights="none" pattern="PDF" /> -->
>
>             Any feedback would be appreciated.
>
>             All the best.
>
>             Denis
>
>             
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
>               Virus-free. www.avg.com
>             
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
>
>
>
>
>         -- 
>         WBR
>         Maxim aka solomax
>
>
>
> -- 
> WBR
> Maxim aka solomax

Reply via email to