Plugin pdf pour WordPress
Un plugin contuttopdf pour obtenir un export au format pdf nettement plus perfomrant que pos2pdf :
Installation
Extrait du site :
- Download the ContuttoPDF plugin.
- Unpack it with a bzip2 unpacking tool (e.g. 7zip).
- Upload the folder
pdf-themes
to yourwp-content/
directory. - Upload the folder
contuttopdf
to yourwp-content/plugins/
directory. - Important: Change the permissions of the directory
wp-content/plugins/contuttopdf/dompdf/lib/fonts
, so that it is writable by the web server. - Go to your Plugins page. In the description text for the ContuttoPDF plugin, click on “compatibility testâ€.
- If all requirements are met and the generating of the demo page works, you can activate the plugin.
- Now put a PDF button on your page with
<?php contutto_pdfbutton(); ?>
somewhere in your template. Instead of a button, you can also have a text, with something like<?php contutto_pdfbutton('This page as PDF'); ?>
. You can apply CSS styling to the anchor via itsid="pdfbutton"
.
Problème
Par défaut, Free tourne avec une version 4 et non 5 de PHP (The ContuttoPDF plugin is based on DOMPDF which requires PHP 5). Il suffit de créer un fichier .htaccess avec la valeur PHP 1 à la racine de votre site.
Concernant les droits d’accès sur le répertoire dompdf je n’ai pas réussi à le résoudre. A priori c’est la mème chose avec wp2pdf
Enfin l’activation du plugin entraine un problème de codage de caractères