collective.documentviewer
integrates DocumentCloud viewer and PDF processing
into Plone.
You can be seen in action the functionality that implements this add-on at the following sites:
- Very nice document viewer.
- OCR.
- Searchable on OCR text.
- Works with many different document types.
- collective.celery integration.
- Lots of configuration options.
- PDF Album view for display groups of PDFs.
Besides displaying PDFs, it will also display:
- Word.
- Excel.
- Powerpoint.
- HTML.
- RTF.
This product has been translated into
- German.
- Spanish.
- Basque.
- French.
- Italian.
- Dutch.
- Simplified Chinese.
You can contribute for any message missing or other new languages, join us at Plone Collective Team into Transifex.net service with all world Plone translators community.
- GraphicsMagick.
- ghostscript (version 9.0 preferred).
- Poppler
- tesseract (optional)
- qpdf
- OpenOffice or LibreOffice (optional, for doc, excel, ppt, etc. types)
- md5 or md5sum command line tool.
Special instructions for CentOS have been contributed by Eric Tyrer. You can access them via the git hub repo file location.
Special instructions for Debian have been contributed by Leonardo J. Caballero G. You can access them via the git hub repo file location.
If on a Linux/Ubuntu/Debian machine you run into an error like:
/var/lib/gems/1.9.1/gems/docsplit-0.7.2/lib/docsplit/image_extractor.rb:51:in `exists?': can't convert nil into String (TypeError) from /var/lib/gems/1.9.1/gems/docsplit-0.7.2/lib/docsplit/image_extractor.rb:51:in `ensure in convert'
This is because the ruby docsplit library is having an issue with the temp folder accesses, and removal of temp files. Just run the following command:
sudo chmod 1777 /tmp && sudo chmod 1777 /var/tmp
And retry the conversion of your document
Normal flow:
git clone git@github.com:collective/collective.documentviewer.git cd collective.documentviewer virtualenv . bin/pip install -r requirements.txt bin/buildout
It it highly recommended to install and configure collective.celery in combination with this package. Doing so will manage all PDF conversions processes asynchronously so the user isn't delayed so much when saving files.
The product can be configured via a control panel item Document Viewer Settings.
Some interesting configuration options:
- Storage Type
- If you want to be able to serve you files via Amazon Cloud, this will allow you to store the data in flat files that can be synced to another server.
- Storage Location
- Where are the server to store the files.
- OCR
- Use
tesseract
to scan the document for text. This process can be slow so if your PDFs do not need to be OCR'd, you may disable. - Auto Select Layout
- For PDF files added to the site, automatically select the document viewer display.
- Auto Convert
- When PDF files are added and modified, automatically convert.
- Auto layout file types
- Types that should automatically be converted to document viewer.
If you want to use it with your own Dexterity content type. You need to edit
the FTI
in ZMI/portal_types/yourtype
to add "documentviewer" in
the available view methods like this:
<property name="view_methods" purge="False"> <element value="documentviewer"/> </property>
Also you need to set the primary field in the schema, for example:
<field name="myfile" marshal:primary="true" type="plone.namedfile.field.NamedBlobFile">
If you choose to use basic file storage instead of ZODB blob storage, there are a few things you'll want to keep in mind.
- Use Nginx to then serve the file system files. This might require you install a local Nginx just for serving file storage on the Plone server. You can get creative with how your file storage is used though.
- Since in Plone's delete operation, it can be interrupted and the deletion of a file on the OS system system can not be done within a transaction, no files are ever deleted. However, there is an action you can put in a cron task to clean up your file storage directory. Just call the url http://zeoinstace/plone/@@dvcleanup-filestorage.
If you currently have page turner installed, this project will supercede it. Your page turner views will work but no future files added to the site will be converted to page turner.
To convert existing view, on every page turner enabled file, there will be a button Document Viewer Convert that you can click to manually convert page turner to document viewer.
To convert all existing views, go to portal_setup
in the ZMI, upgrades,
select collective.documentviewer
, click to show old upgrades and there
should be an upgrade-all step to run.
This add-on is tested using Travis CI. The current status of the add-on is:
Have an idea? Found a bug? Let us know by opening a ticket.
- Issue Tracker: https://github.com/collective/collective.documentviewer/issues
- Source Code: https://github.com/collective/collective.documentviewer
- Documentation: https://www.documentcloud.org/
This product was developed by Wildcard Corp. team.
The project is licensed under the GPLv2.