Download Plone content views as PDF
Project description
Description
aws.pdfbook is a component for Plone 3 or Plone 4 that enables to download content rendered to PDF. It provides support for default content types. Third party content type authors and integrators may add support to their personal content types through dedicated Zope 3 named views.
When downloading a Folder or a Topic/Collection, all subcontents is included in the PDF document but not recursively.
Requirements
The following softwares should be installed:
Plone 3 or 4
htmldoc (required)
recode (optional)
Installation
Instance wide
In your buildout.cfg file:
[buildout] ... eggs = ... aws.pdfbook
We assume that:
The site charset is utf-8
The server buffer for downloading has 40000 bytes.
Otherwise you can change these default values in your zope.conf or in buildout.cfg like this:
[instance] recipe = plone.recipe.zope2instance ... zope-conf-additional = ... <product-config aws.pdfbook> # Your site charset (default: utf-8) site-charset utf-8 # The download buffer bytes size (default: 40000) download-buffer-size 40000 </product-config> ...
Plone site
In your Plone site go to the ‘Site Setup’ page and click on the ‘Add/Remove Products’ link.
Choose aws.pdfbok (check its checkbox) and click the ‘Install’ button.
The go as soon as possible to the PDF Book configuration panel and configure according to your system settings and your layout preferences.
More particularly, you may change default pdfbook options. See the pdfbook documentation for the various available options.
Other setups
It is strongly recommanded to use linking with UID in your visual editor preferences. Otherwise images may not display in topics prints.
Developers
Customizing default templates in ZMI
Open your Plone site in ZMI, then the portal_view_customization object.
Click on a link printlayout that suits the interface of the content items you want to customize.
Change the template as you prefer…
Add a template for your content types
Assuming you have a personal content type that implements the myproduct.interfaces.IMyContentType interface, You must add a view like this one:
<browser:page name="printlayout" for="myproduct.interfaces.IMyContentType" layer="aws.pdfbook.interfaces.IAWSPDFBookLayer" permission="zope.Public" template="templates/mycontenttype.pt" />
Keep the following attributes as above:
name="printlayout"
layer="aws.pdfbook.interfaces.IAWSPDFBookLayer"
permission="zope.Public"
Examples for standard content types are provided in the browser/transformers.zcml configuration and associated files.
Otherwise aws.pdfbook provides a default template that may or may not fit with paper layout.
If the default layout for personal or third party content types is somehow awful, you may blacklist such content types in the configuration panel.
Contributors
The subversion repository for this component is https://svn.plone.org/svn/collective/aws.pdfbook .
The development kit comes with a buildout.cfg for the latest Plone stable version.
Please don’t forget to file your changes in the docs/HISTORY.txt file.
Support
Please use the tracker at http://plone.org/products/aws.pdfbook/issues
Credits
Original version for Plone 2.x by John Doe
Plone 3.x support by Gilles Lenfant for Alter Way Solutions
Sponsored by Materis
Changelog
1.0.0b1
i18nisation and added french translation [glenfant]
Unit tests [glenfant]
Cleaned up useless code from Products.PDFBook [glenfant]
1.0.0a1
Initial release [glenfant]