// récupération du contenu HTML
$ch = curl_init('http://domain.tld:1081/spip.php?page=fiche_pdf&id_article=50');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, "http://proxy.domain.tld");
curl_setopt($ch, CURLOPT_PROXYPORT, 8080);
$content = curl_exec($ch);
$content = utf8_decode($content);
$content = html_entity_decode($content, ENT_QUOTES);
// conversion HTML => PDF
require_once(dirname(__FILE__).'/html2pdf/html2pdf.class.php');
try {
$html2pdf = new HTML2PDF('P','A4','fr', false, 'ISO-8859-15');
// $html2pdf->setModeDebug();
$html2pdf->setDefaultFont('Arial');
$html2pdf->writeHTML($content, isset($_GET['vuehtml']));
$html2pdf->Output('exemple00.pdf');
}
catch(HTML2PDF_exception $e) { echo $e; }