Provides PDF export functionality for Plone content.
- Exports Documents, Event, News items and other custom content.
- Can be customized via CSS in the PDF Export control panel.
- Long tables which will be rendered on more than one page, will have the thead repeated on every page.
- One can use Plone body tag CSS classes to define CSS rules for specific Plone content.
This add-on is based on the great WeasyPrint library.
This product has been translated into
- english
- german
Install plone.pdfexport by adding it to your buildout:
[buildout] ... eggs = plone.pdfexport
and then running bin/buildout
Note: for Python 2 (Plone 5.1) you have to pin some packages:
weasyprint = 0.42.3 cairocffi = 0.9.0 tinycss2 = 0.6.1 soupsieve = 1.9.6 cssselect2 = 0.2.2
After installing the add-on you can call the "aspdf" view on any Plone content.
http://localhost:8080/Plone/news/aspdf
for testing, you can add the GET parameter "html=1" to see the HTML version before it get rendered into a PDF.
http://localhost:8080/Plone/news/aspdf?html=1
We provide portrait and landscape mode with separate page setting for each mode:
@page {
margin: 2.75cm 1.4cm 1.4cm 1.4cm;
size: landscape;
@top-center {
font-size:12px;
color:#666666;
content: "Beautiful Plone content, deserves a beautiful PDF export!";
}
@bottom-left {
font-size:12px;
color:#666666;
content: "provided by derico.de";
}
@bottom-right {
font-size:12px;
color:#666666;
content: "Page " counter(page);
}
}
You can set which mode is the default. To use a different mode, you can add a request parameter:
http://localhost:8080/Plone/front-page/aspdf?mode=landscape http://localhost:8080/Plone/front-page/aspdf?mode=portait
This add-on was build by Derico [MrTango].
- Issue Tracker: https://github.com/plone/plone.pdfexport/issues
- Source Code: https://github.com/plone/plone.pdfexport
If you are having issues, please let us know.
The project is licensed under the GPLv2.