CWP\PDFExport\Extensions\PdfExportExtension
Synopsis
class PdfExportExtension
extends DataExtension
{
- // members
- private static bool $pdf_export = false;
- private static string $pdf_base_url = '';
- private static string|null $wkhtmltopdf_binary = NULL;
- private static string $generated_pdf_path = 'assets/_generated_pdfs';
- // methods
- public void getPdfFilename()
- public void PdfLink()
- public void onAfterPublish()
- public void onAfterUnpublish()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Members
private
- $generated_pdf_path
—
string
Where to store generated PDF files - $pdf_base_url
—
string
Domain to generate PDF's from, DOES not include protocol i.e. google.com not http://google.com - $pdf_export — CWP\PDFExport\Extensions\bool
- $wkhtmltopdf_binary
—
CWP\PDFExport\Extensions\string|null
Allow custom overriding of the path to the WKHTMLTOPDF binary, in cases where multiple versions of the binary are available to choose from. This should be the full path to the binary (e.g. /usr/local/bin/wkhtmltopdf)
Methods
public
- PdfLink() — Build pdf link for template.
- getPdfFilename() — Return the full filename of the pdf file, including path & extension
- onAfterPublish() — Remove linked pdf when publishing the page, as it would be out of date.
- onAfterUnpublish() — Remove linked pdf when unpublishing the page, so it's no longer valid.