2017 © Pedro Peláez
 

silverstripe-module silverstripe-dompdf

SilverStripe PDF Generation via DOMPDF Library

image

gdmedia/silverstripe-dompdf

SilverStripe PDF Generation via DOMPDF Library

  • Wednesday, February 17, 2016
  • by gurudigital
  • Repository
  • 5 Watchers
  • 1 Stars
  • 4,515 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 19 Forks
  • 0 Open issues
  • 2 Versions
  • 5 % Grown

The README.md

PDF Generation via DOMPDF Library

This is a fork of https://github.com/burnbright/silverstripe-dompdf for use with Composer., (*1)

Maintainer: Jeremy Shipman (jeremy@burnbright.net), (*2)

Makes use of: https://github.com/dompdf/dompdf Dompdf websites: http://dompdf.github.com/, http://pxd.me/dompdf/www/, (*3)

Input:, (*4)

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

Output, (*5)

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

Installation

Composer

  • On the command line, cd into your sites root folder
  • Run composer require gdmedia/silverstripe-dompdf
  • Run dev/build?flush=all in your browser

Manually

  • Download the module from https://github.com/guru-digital/silverstripe-dompdf/archive/master.zip
  • Extract the files into your silverstripe root folder
  • Run dev/build?flush=all in your browser

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., (*6)

You can check your html before it is converted like this:, (*7)

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

Useful Tips

The Versions

17/02 2016

dev-master

9999999-dev

SilverStripe PDF Generation via DOMPDF Library

  Sources   Download

The Requires

 

03/11 2015

0.0.1

0.0.1.0

SilverStripe PDF Generation via DOMPDF Library

  Sources   Download

The Requires