I am storing my certificate theme in database as a html. my template fonts are weeding fornt. themes looks nice in browser out put . but when i tried to fetch from databse and disply in pdf the normal font output is coming . i am not getting where i am wrong .
code for storing template in databse :
<?php
ob_start();
?>
<head>
<link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8" />
<style type="text/css">
h1{
font-family: 'weddingtext_btregular';
font-weight:200;
font-size:25px;
}
h2{
font-family: 'weddingtext_btregular';
font-weight:300;
font-size:30px;
}
.span {
font-family: cursive;
}
.span1 {
padding-left:20%;
}
.span2 {
padding-left:50%;
}
</style>
</head>
<?php
// normal output
echo '<img alt="Nimhans Logo" src="img/1.png" width="100%" ; />
<h1>SL NO. <span class="span">##SLNO##</span></h1>
<div class="body">
<center><h1>Institute of National Importance</h1></center>
<center><h1>Bengaluru - 560 029</h1></center>
<br>
<center><h1>Certifies that</h1></center>
<br>
<center><h2>##NAME##</h2></center>
<br>
<center><h1>has been dulg admitted to the Degreeof</h1> </center>
<br>
<center><h2>##COURSE##</h2></center>
<br>
<center><h1>in recognition of the fulfilment of requirements</h1></center>
<center><h1>under the statutes of the institute</h1></center>
<center><h1>##YEAR##</h1></center>
<br>
<center><h2>##CLASS##</h2></center>
<br>
<h1>##QRCODE## <span class="span1"> Biben under the seal of the Institute</span></h1>
<br>
<br>
<h1>Date:29th November, 2015 <span class="span2"> Director/Dice Chancellor</span></h1>
';
// store buffer to variable and turn output buffering offer
$html = ob_get_clean();
echo $html;
include 'configaration/config.php';
$html = mysql_real_escape_string($html);
$dpt_name = "Nursing";
$qry = "INSERT INTO certificate (cert_data,department)
VALUES ('$html','$dpt_name')";
if (!mysql_query($qry)) {
die('Error: ' . mysql_error());
}
?>
fetching template from databse and displaying in PDF.
here is my code :
$qry1 = "SELECT * FROM certificate WHERE department = '" . $dpt_name . "'";
$result1 = mysql_query($qry1);
if ($result1) {
while ($row = mysql_fetch_array($result1)) {
$template_data = $row["cert_data"];
}
}
$template_data = str_replace('##NAME##', $std_name, $template_data);
$template_data = str_replace('##FROM##', $join_date, $template_data);
$template_data = str_replace('##NAME##', $std_name, $template_data);
$template_data = str_replace('##TO##', $to, $template_data);
ob_end_clean();
include 'MPDF57/mpdf.php';
$mpdf = error_reporting(E_STRICT);
$mpdf = new mPDF('win-1252', 'A4', '', '', 15, 10, 16, 10, 10, 10);
$mpdf->Bookmark('Start of the document');
$mpdf->SetDisplayMode('fullpage');
$mpdf->WriteHTML($template_data);
$mpdf->Output();
exit();
browser output :
PLEASE HELP ME WHERE I AM WRONG . SORRY FOR MY BAD ENGLISH .