Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,32 @@ | ||
# PDF Generation via DOMPDF Library | ||
|
||
Maintainer: Jeremy Shipman (jeremy@burnbright.net) | ||
|
||
# Writing templates | ||
|
||
You'll want to | ||
|
||
* Use tables for layout | ||
|
||
|
||
http://code.google.com/p/dompdf/ | ||
|
||
Input: | ||
|
||
* SS Template + data | ||
* HTML string (which could be rendered template) | ||
* HTML File | ||
|
||
Output | ||
|
||
* PDF File location | ||
* SS File | ||
* PDF binary stream | ||
* PDF binary stream to 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. | ||
|
||
You can check your html before it is converted like this: | ||
|
||
echo $mydataobject->renderWith('MyTemplate');die(); |