Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Bom dia a todos,
eu estou com problema ao gerar relatório com o DOMPDF, ele não reconhece as classes do CSS que modifica os testos.
Aqui vai um exemplo.
<?php
date_default_timezone_set('America/Sao_Paulo');
require_once('util/dompdf/dompdf_config.inc.php');
$html = '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<title>Proposta</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style>
body {
padding: 0;
margin: 0;
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
}
.numero-orcamento {
font-size: 20px;
font-weight: bold;
color: #000;
text-align: center;
}
td.th {
font-weight: bold;
text-transform:uppercase;
text-align: right;
}
.th-descricao {
font-weight: bold;
text-transform:uppercase;
}
td.td {
text-transform:uppercase;
text-align: left;
}
.table-dados { border: 1px solid #CCC; margin-top: 5px; }
.titulo-table {
font-size: 12px;
font-weight: bold;
color: #000;
background-color: #E2E2E2;
height: 25px;
}
.titulo-descricao {
height: 25px;
background-color: #E2E2E2;
}
.titulo-proposta {
font-family: Arial, Helvetica, sans-serif;
font-size: 18px;
font-weight: bold;
color: #000;
text-align: center;
}
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="23%" rowspan="2" align="center" valign="middle">
<img src="../imagens/nova_logo.png" width="140" height="93" border="0" />
</td>
<td width="52%" height="30" class="titulo-proposta">PROPOSTA</td>
<td width="25%" rowspan="2" class="numero-orcamento">Nº. '. $codigoBarrasCesta .'</td>
</tr>
<tr>
<td valign="middle">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="29%" class="th">CNPJ:</td>
<td width="71%" class="td"> '. $fet_cliente['cnpj_filial'] .'</td>
</tr>
<tr>
<td class="th">EMPRESA:</td>
<td class="td"> '. $fet_cliente['nome_filial'] .'</td>
</tr>
<tr>
<td class="th">I.E:</td>
<td class="td"> '. $fet_cliente['insc_estadual_filial'] .'</td>
</tr>
<tr>
<td class="th">DATA DA EMISSÃO:</td>
<td class="td"> '. date('d/m/Y') .'</td>
</tr>
</table>
</td>
</tr>
</table>';
$html = stripslashes($html);
$old_limit = ini_set("memory_limit", "16M");
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->set_paper('a4', 'portrait');
$dompdf->render();
$dompdf->stream("teste.pdf", array("Attachment" => 0));
?>
Alguem pode me dar uma dica de como eu posso resolver este problema, que o DOMPDF reconheça meu CSS.Neste caso eu não consigo modificar a fonte dos textos.
Desde já agradeço pela atenção.
Carregando comentários...