html2pdf将html从url转换为pdf

Trying to generate PDFs with html2pdf. I want to generate using a URL.

The code I have generates a PDF, but the PDF is blank which, I assume, means not HTML is being pulled from the specified url.

require_once(dirname(__FILE__).'/html2pdf.class.php');
$url = 'http://example.com/survey/exportpdf.php?id=6';
try
{
    $html2pdf = new HTML2PDF('P', 'A4', 'en');
    //$html2pdf->setModeDebug();

    $html2pdf->getHtmlFromPage($url);

    $html2pdf->Output($id.'.pdf','D');
}
catch(HTML2PDF_exception $e) {
    echo $e;
    exit;
}

Is anyone familiar with html2pdf? I've gone through the docs and the examples, but I can't find any reference to this method. I've found the definition here, but it doesn't tell much.

use the below code to get the url html :

$html = file_get_contents($url);
$html2pdf->writeHTML($html, isset($_GET['vuehtml']));