1

Hi.
Thank you for this amazing plugin.
This is what I did in main file:
ob_start();
include('ac_order_form.php');
$content = ob_get_clean();

// convert in PDF
require_once('/html2pdf/html2pdf.class.php');
try
{
$html2pdf = new HTML2PDF('P', 'A4', 'fr');
$html2pdf->writeHTML($content, isset($_GET['vuehtml']));
$html2pdf->Output('exemple01.pdf');
}
catch(HTML2PDF_exception $e) {
echo $e;
exit;
}
And in the "ac_order_form.php" file I put these code lines.
<style>
.main_wrapper{
width:816px;
height:1056px;
padding:30px;
border:1px solid black;
}
.column_wrapper{
width:100%;
}
.center_text{
text-align:center;
}
.main_title{
font-size:24px;
font-family:sans;
font-weight:bold;
color:black;
}
.main_description{
font-size:13.33px;
font-weight:400;
font-family:sans;
color:black;
}
.main_label{
font-size:11.58px;
font-weight:400;
font-family:sans;
color:black;
line-height:11.58px;
}
</style>
<page style="font-size: 10pt">
<div class="main_wrapper">
<div class="column_wrapper center_text">
<img src="img.png" style="float:left;"/>
<img src="img.png" style="float:right;"/>
<div class="main_title">
American Carports, Inc.
</div>
<div class="main_description">
457 North Broadway Street • Joshua, TX 76058 — Corporate Headquarters
</div>
<div class="main_description">
866-730-9865 • Fax this form to 817-484-2182 or 866-396-2057
</div>
<div class="main_description">
Customer Service Issues: 866-730-9865, ext. 306
</div>
</div>
</div>
</page>
But "TCPDF ERROR: Could not include font definition file: sans" is occured and I am stuck.
A little help?
Thank you very much.

2

The name of the font is probably not "sans", but "dejavusans".

If you use that font through the document you could omit it in the style declarations and add:

$html2pdf->setDefaultFont('dejavusans');
html2pdf 4.03

3

Thank you for your service.
I've fixed the font problem but faced another problem.
"TCPDF ERROR: Some data has already been output, can't send PDF file"
Please help me one more.
Regards.

4

Try to comment out the two lines with images:
<img src="img.png" style="float:left;"/>
<img src="img.png" style="float:right;"/>

Are all the tags closed correctly?

Difficult to answer - searching Google for "TCPDF ERROR: Some data has already been output, can't send PDF file"
gives 25000 results.
html2pdf 4.03

5

You should check the HTTP headers, or maybe it's because of a BOM if your source code is written in utf8? (http://stackoverflow.com/questions/13702522/utf-8-bom-and-headers-in-php)

6

Cómo puedo hacer para que las tablas que aparecen en el pdf generado aparezcan centradas, utilizo el HTML2PDF??
Ayuda, por favor!