Carry out the following steps:
Create a new directory called
pdf
in theblocks
directory of your site. Within that directory, add a new file calledcontroller.php
and insert the following lines:<?php defined('C5_EXECUTE') or die('Access Denied.'); class PdfBlockController extends BlockController { protected $btInterfaceWidth = "200"; protected $btInterfaceHeight = "140"; public function getBlockTypeDescription() { return t("Add a PDF-Generation link in your web page."); } public function getBlockTypeName() { return t("PDF Generator"); } }
Here's a new element. As generating PDF files isn't that easy, we're going to use a library for this. Go to http://www.mpdf1.com/mpdf/ and download the latest ZIP version (at the time of writing the latest is version 5.6). Extract the ZIP file into
libraries
but make sure it's the one in the root, not in the folderconcrete
.