1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

html2pdf error

Discussion in 'PHP' started by tirso, Jul 30, 2008.

  1. #1
    Does anyone could help me how to fix this kind of error in html2pdf. Actually I simply copy the sample code for me to test but id doesn't work.

    thanks in advance

    here is the error

    Fatal error: Call to undefined method HTML2FPDF::DisplayPreferences() in C:\xampp\htdocs\infinity_other\html2pdf\html2fpdf.php on line 155

    <?
    require('html2pdf/html2fpdf.php');
    $pdf=new HTML2FPDF();
    $pdf->AddPage();
    $fp = fopen("sample.html","r");
    $strContent = fread($fp, filesize("sample.html"));
    fclose($fp);
    $pdf->WriteHTML($strContent);
    $pdf->Output("sample.pdf");
    echo "PDF file is generated successfully!";
    ?>
    PHP:
     
    tirso, Jul 30, 2008 IP
  2. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #2
    Well, I am going to take a guess here. The html2fpdf.php file calls the DisplayPreferences method defined in the fpdf.php file. Is the fpdf.php file in the same directory as the html2fpdf.php file? Just a thought. Also, if you have a PHP debugger set a breakpoint and you will discover why the code does not work.
     
    Social.Network, Jul 30, 2008 IP