This is an archived forum post. The information may be outdated. Contact us if you have any questions.
<tr ><td width="50" align="right" class="pregunta">1144</td><td width="200" class="pregunta"> <img src="./img/verde.gif" height="10" width="173"></td></tr> <tr ><td width="50" align="right" class="pregunta">1153</td><td width="200" class="pregunta"> <img src="./img/verde.gif" height="10" width="176"></td></tr>
echo "<td width=\"200\" class=\"arean\">"; grafico($nota); echo "</td>";
function grafico ($valor) { if ($valor<=2) { $color="rojo.gif"; } elseif ($valor>3) { $color="verde.gif"; } else { $color="amarillo.gif"; } if ($valor!="") { $ancho= $valor; $ancho=number_format($ancho,0); ?> <img alt="grf" src="./img/<?php echo $color;?>" height="10" width="<?php echo $ancho;?>"> <?php } }
ob_start();
$HtmlCode= ob_get_contents(); if (isset($_SESSION['htmlpdf'])) { $_SESSION['htmlpdf']=($HtmlCode); } ob_end_flush();
<a class="param" href="pdfprint.php">PDF</a>
<?php session_start(); require 'pdfcrowd.php'; if (isset($_SESSION['htmlpdf'])) { $html=$_SESSION['htmlpdf']; //i save the result of the buffered document in a file file_put_contents("pdf.html", $html); $client = new Pdfcrowd("my", "mine"); $client->setPageWidth('8.25in'); $client->setPageHeight('11.7in'); $client->enableHyperlinks(FALSE); //$client->enableImages(TRUE); //$client->usePrintMedia(); try { header('Content-type: application/pdf'); header('Content-Disposition: attachment; filename="impresion.pdf"'); echo $client->convertURI('http://mysite.com/pdf.html'); } catch(PdfcrowdException $e) { echo $e->getMessage(); } } ?>