Skip to content

Easily create PDF files in SilverStripe with this module

Notifications You must be signed in to change notification settings

3Dgoo/silverstripe-dompdf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Silverstripe dompdf

This module provides PDF generation through the dompdf library for Silverstripe 3.

This is a fork of:

Input:

  • HTML string (which could be a rendered template)
  • HTML File

Output

  • PDF file location
  • SS file
  • PDF binary stream to browser

Installation (with composer)

$ composer require 3dgoo/silverstripe-dompdf

Example usage

$pdf = new SS_DOMPDF();
$pdf->setHTML($mydataobject->renderWith('MyTemplate'));
$pdf->render();
$pdf->toFile('mypdf.pdf');

Debugging

The $pdf->streamdebug(); function is useful for quickly viewing pdfs, particularly if your browser supports displaying pdfs, rather than downloading.

You can check your html before it is converted like this:

echo $mydataobject->renderWith('MyTemplate');
die();

Useful Tips

About

Easily create PDF files in SilverStripe with this module

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%