I am using mPDF and it is only generating the reports correctly in FireFox or opening by IE. If I try to open the file with PDF reader it returns the error when loading PDF document.
<?php
include("../crud/_views/plugins/mpdf60/mpdf.php");
$html = "
teste
";
$mpdf = new mPDF('','', '', '', 55, 18, 19, 15, 0, 0, '');
$css = file_get_contents('../crud/_views/plugins/mpdf60/estilo.css');
$mpdf->WriteHTML($css,1);
$mpdf->WriteHTML($html,2);
$mpdf->Output('');
By the code I noticed that the error is generated in line $mpdf->WriteHTML($css,1);
, if I remove it the PDF is displayed normally, but does not stay with the css style.
Style.css file
.titulo{
font-size: 14px;
font-family: Times, "Times New Roman";
font-weight: bold;
}
.sub-titulo{
font-size: 12px;
font-family: Times, "Times New Roman";
font-weight: bold;
}
.numero{
text-decoration: underline;
}
.direita{
text-align: right;
}
.center{
text-align: center;
}
.alinhamento{
margin-right: : 10%;
}
.direita{
text-align: right;
}