Download the PHP package creativesynergy/silverstripe-wkhtmltopdf without Composer
On this page you can find all versions of the php package creativesynergy/silverstripe-wkhtmltopdf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download creativesynergy/silverstripe-wkhtmltopdf
More information about creativesynergy/silverstripe-wkhtmltopdf
Files in creativesynergy/silverstripe-wkhtmltopdf
Package silverstripe-wkhtmltopdf
Short Description Adds the possibility to create PDFs from all DataObjects with WKHTMLTOPDF
License BSD-3-Clause
Homepage https://github.com/creativeSynergy/silverstripe-wkhtmltopdf
Informations about the package silverstripe-wkhtmltopdf
This module is now abandoned, for SilverStripe 4 you can use my new and improved version silverstripe-wkhtmltox
Create PDFs in SilverStripe with the power of WKhtmlTOpdf
This module adds the possibility to simply create PDFs from every DataObject you have. Based on WKhtmlTOpdf and mikehaertl's php wrapper.
Installation
Getting started
- WKhtmlTOpdf must be installed on your server to use this module
- You'll need to copy the footer.html and header.html files from the module templates folder to
mysite/templates/Pdf/
- Create a css file called 'pdf.css' located under
themes/your-theme/css/
Usage
Basics
Add a cover
Add pages
Add specific options for one page
All available options can be found here
Add a page and pass some variables to it
Change the page template
By default the module will look for a template called "ClassName_pdf"
Preview in browser
Save
Specify the folder to save in
Download
Global options
Set the global options used for all pages in this pdf
Set or modifiy only one global option
Remove one global option
Templates, Header & Footer and Styling
Page template
If your page ist based on an DataObject and you generate the html with the $pdf::getHtml() function, you'll be able to set a specific template to use for this page by passing it as third parameter to the function (without the .ss ending!). By default, the module will search for a template called "Classname_pdf".
Header & Footer
WKhtmlTOpdf let you specify seperate files for your pdf's header and footer section. By default they are located under mysite/templates/Pdf/header.html
and mysite/templates/Pdf/footer.html
.
You can change the location of those files or remove the header and/or footer completely by changing the global or page specific options.
Demo Pdf.ss, header.html and footer.html files are included to get you started
Styling
Thanks to WKhtmlTOpdf you have full CSS3 and HTML5 support and will be able to do fancy things "without" the limitations you'll have to face while using other tools like dompdf or tcpdf. You can even use javascript to modify your pages.
By default the module requires a pdf.css in under themes/your-theme/css/pdf.css You can change this by setting the global or page specific option