Tuesday, July 30, 2013

Plone - Review documents in Plone with documentviewer

To enable Plone to be able to review my uploaded documents, I will install the documentviewer addon.

Addon URL: http://plone.org/products/document-viewer

Following these steps:

A. Install the dependencies:
  1. Grab the gem:
    gem install docsplit
  2. Install GraphicsMagick. Its ‘gm’ command is used to generate images.
    Either compile it from source, or use a package manager:
    sudo apt-get install graphicsmagick
  3. Install Poppler. On Linux, use aptitude, apt-get or yum:
    sudo apt install poppler-utils poppler-data
  4. (Optional) Install Ghostscript:
      sudo apt-get install ghostscript
    Ghostscript is required to convert PDF and Postscript files.
  5. (Optional) Install Tesseract:
      sudo apt-get install [tesseract | tesseract-ocr]
    Without Tesseract installed, you'll still be able to extract text from documents, but you won't be able to automatically OCR them.
  6. (Optional) Install pdftk. On Linux, use aptitude, apt-get or yum:
    sudo apt-get install pdftk
  7. (Optional) Install LibreOffice. On Linux, use aptitude, apt-get or yum:
     sudo apt-get install libreoffice 
  8. md5 or md5sum command line tool which is buit-in with Ubuntu
 B. Install documentviewer:

  1. Open the buidout configure file located at Plone/zinstance/buildout.cfg, and add the following line to the eggs part:

    eggs =
  2.  Run buildout from your Plone installation dir to install, in my case:

  3. Restart Zope instance:

    /home/vagrant/Plone/zinstance/bin/plonectl restart
And from now on, whenever you upload a document to your Plone site, it will be rendered to be able to view before you download it (this behaviour is changeable in the Document Viewer Options)