Document Conversion

Plone Intranet renders previews of office documents (LibreOffice, MS Office). This is not only beautiful, but also very practical since it enables you to visually recognize the “right” document you were looking for.


This subsystem is being radically refactored right now. This documentation will be updated when that’s done.


ploneintranet.doccconv.client generates previews for office documents.

How it works

When a content object is added, an event handler (see triggers the preview generation. If is set up, the previews are generated asynchronously. The actual preview generation can be delegated to an external server that is running slc.docconv. Alternatively it can happen locally. For local generation the package must be installed with the local extra. This in turn requires docsplit (and dependencies, including libreoffice for office document support) to be installed. Upon completion the previews are stored in annotations on the object. In addition to the preview images a PDF version of the object is generated and stored. There are views in that allow the previews and pdfs to be displayed.


Currently most of the configuration is static ( The plan is to replace this by a proper TTW configuration. The URL of the external slc.docconv server is currently stored in site_properties (string docconv_url). This could also be moved to e.g. plone.registry.

Optionally use wkhtml2pdf

If wkhtml2pdf is available, it can be used to convert HTML documents into PDFs. The PDFs and the previews produced by wkhtml2pdf will have better quality and will look more similar to what you see in your browser given that they will include Ploneintrasnet’s CSS styles.

This has been tested on:

  1. Ubuntu bionic (apt install wkhtmltopdf)
  2. On Ubuntu Xenial installing via dpkg the package you can fetch from
  3. On NixOS (installing wkhtmltopdf-0.12.4, with patched QT)

To enable it edit the value of the registry record ploneintranet.docconv.wkhtmltopdf.options. You can either set it to an empty value or you can set it to a meaningfull value like --margin-bottom 2cm --margin-left 2cm --margin-right 2cm --margin-top 3cm --disable-javascript --viewport-size 10000x10000 To disable it the registry record value should be disabled. See the `wkhtmltopdf`_ extended help (wkhtmltopdf -H) for the the available options.


ploneintranet.attachments stores previews for office documents.

How it works

Make a content type support attachments by having it implement IAttachmentStoragable. The provided adapter is used to add and retrieve values:

>>> storage = IAttachmentStorage(obj)
>>> storage.add('test.doc', attachment_obj)
>>> retrieved = storage.get('test.doc')

To list the ids of available attachments:

>>> storage.keys()

To delete an attachment:

>>> storage.remove('test.doc')


Attachment previews on normal Plone objects, like Files, can be uploaded via the @@upload-attachments helper view, which is protected by cmf.AddPortalContent, and accessed via the @@attachments helper view, which is protected by zope2.View.

Attachments for microblog Statusupdates follow a more convoluted route. They’re uploaded via @@upload-statusupdate-attachments which is protected by ploneintranet.microblog.AddStatusUpdate which means that even normal users that are not allowed to add content to a specific context, like the site root, will be enabled to add attachments and previews on that context.

While composing a StatusUpdate, the updates are temporarily stored on the context, i.e. the workspace or siteroot where the posting widget is shown. This enables showing previews even before submitting a new post. When the post is submitted, the attachments are stored as an annotation on the actual StatusUpdate and the temporary attachment on the context is removed. There’s an additional garbage collection routine that makes sure no stale temporary attachments older than one day remain behind.

In the initial temporary stage, the status attachments can be accessed by the normal @@attachments helper view on the microblog context, which is protected by the View permission on the context.


Even “private” workspaces currently allow View for any logged-in user. That will be locked down to only workspace members in the near future.

After the StatusUpdate is stored, Statusupdate attachments can be retrieved via the @@status-attachments view, which is protected with ploneintranet.microblog.ViewStatusUpdate, and is defined on INavigationRoot (toplevel stream) and on IMicroblogContext (workspace stream).