-
-
Save baileylo/1711470 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
$prev_line = false; | |
foreach ($data as $line){ | |
// go through each line, showing it as required, if it is surrounded by '<>' then | |
// assume that it is a title | |
$prev_line = $line=chop($line); | |
if (strlen($line) && $line[0]=='#'){ | |
// comment, or new page request | |
switch($line){ | |
case '#NP': | |
$pdf->ezNewPage(); | |
break; | |
case '#C': | |
$pdf->selectFont($codeFont); | |
$textOptions = array('justification'=>'left','left'=>20,'right'=>20); | |
$size=10; | |
break; | |
case '#c': | |
$pdf->selectFont($mainFont); | |
$textOptions = array('justification'=>'full'); | |
$size=12; | |
break; | |
case '#X': | |
$collecting=1; | |
break; | |
case '#x': | |
$pdf->saveState(); | |
eval($code); | |
$pdf->restoreState(); | |
$pdf->selectFont($mainFont); | |
$code=''; | |
$collecting=0; | |
break; | |
case '#I': | |
$collecting=1; | |
break; | |
case '#i': | |
$pdf->addPngFromFile($prev_line); | |
$collecting=0; | |
break; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment