giving error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mukeshrasm
    Contributor
    • Nov 2007
    • 254

    giving error

    [CODE=php]<?php

    // create new document
    pdf_new();
    $pdf = pdf_new();
    pdf_open_file($ pdf);
    pdf_begin_page( $pdf, 500, 700);

    // define a font
    $font = pdf_findfont($p df, "Courier", "host", 0);
    pdf_setfont($pd f, $font, 20);

    // display some text
    pdf_show_xy($pd f, "Hello World", 50, 650);
    pdf_end_page($p df);
    pdf_close($pdf) ;

    // output document
    $data = pdf_get_buffer( $pdf);
    header("Content-type: application/pdf");
    header("Content-disposition: inline; filename=test.p df");
    header("Content-length: " . strlen($data));
    echo $data;
    ?>[/CODE]

    Error: Call to undefined function pdf_new() in D:\mukesh\www\p df.php
    why this code is giving error.
    Last edited by gits; Dec 10 '07, 12:03 PM. Reason: added code tags
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5388

    #2
    hi ...

    since that is not a javascript-question ... i've moved it over to the php-forum where the experts may certainly help you with that problem ...

    kind regards

    Comment

    • brettl
      New Member
      • Sep 2007
      • 41

      #3
      Make sure that pdflib is installed in your version of php.

      Comment

      • mukeshrasm
        Contributor
        • Nov 2007
        • 254

        #4
        Originally posted by brettl
        Make sure that pdflib is installed in your version of php.

        I have made changed in php.ini by uncommenting the extension=php_c pdf.dll and extension=php_p df.dll but still it is not working
        what is the reason don't know

        And how can I install the pdflib. I am using WAMP Server. PHP2.0.

        Comment

        • brettl
          New Member
          • Sep 2007
          • 41

          #5
          Well you should at least be using PHP 4.0 for this library to function. Upgrade to PHP 5 if you can.

          If you are using a PC you should see a little gauge type thing in your tool bar. This is the WAMP icon and you and get access to the WAMP GUI from there.

          Left click on the icon and a menu should pop up. Then click on PHP Settings. Then click PHP Extensions. From there scroll down until you find "php_pdf" and click it. Then restart your server and you should have the pdf library installed.

          Hope This Helps.
          Let me know.

          Comment

          Working...