- Upload the whole plugin folder to your /wp-content/plugins/ folder.
- Set write permission (777) to the plugin dir folder => wp-mpdf/cache OR /wp-content/wp-mpdf-themes/cache
- Go to the plugins page and activate the plugin.
- Add to your template "<?php if(function_exists('mpdf_pdfbutton')) mpdf_pdfbutton(); ?>" as a small button or "<?php if(function_exists('mpdf_pdfbutton')) mpdf_pdfbutton(false, 'my link', 'my login text'); ?>" as a textlink. The second text specifies the text which should displayed if you have checked "needs login" and a user isn't logged in.
(if you wish to open the pdf print in a new tab you may pass "true" for the first parameter)
- You can adjust some options: in your admin interface, click on plugins and then on wp-mpdf. For allowing or disabling pdf export you can use the checkbox when creating/editing a post or a page.
- Place your templates into /wp-content/wp-mpdf-themes
The mpdf_pdfbutton function signature:
function mpdf_pdfbutton($opennewtab=false, $buttontext = '', $logintext = 'Login!', $print_button = true, $nofollow = false, $options = array())
The options array supports 'pdf_lock_image' => '/my/image/path/relative/to/wordpress/route' and 'pdf_image' => '/my/image/path/relative/to/wordpress/route' to overwrite which icon should be used.