By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,261 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

giving error

100+
P: 254
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. // create new document
  4. pdf_new();
  5. $pdf = pdf_new();
  6. pdf_open_file($pdf);
  7. pdf_begin_page($pdf, 500, 700);
  8.  
  9. // define a font
  10. $font = pdf_findfont($pdf, "Courier", "host", 0);
  11. pdf_setfont($pdf, $font, 20);
  12.  
  13. // display some text
  14. pdf_show_xy($pdf, "Hello World", 50, 650);
  15. pdf_end_page($pdf);
  16. pdf_close($pdf);
  17.  
  18. // output document  
  19. $data = pdf_get_buffer($pdf);
  20. header("Content-type: application/pdf");
  21. header("Content-disposition: inline; filename=test.pdf");
  22. header("Content-length: " . strlen($data));
  23. echo $data;
  24. ?>
Error: Call to undefined function pdf_new() in D:\mukesh\www\pdf.php
why this code is giving error.
Dec 10 '07 #1
Share this Question
Share on Google+
4 Replies


gits
Expert Mod 5K+
P: 5,268
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
Dec 10 '07 #2

brettl
P: 41
Make sure that pdflib is installed in your version of php.
Dec 10 '07 #3

100+
P: 254
Make sure that pdflib is installed in your version of php.

I have made changed in php.ini by uncommenting the extension=php_cpdf.dll and extension=php_pdf.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.
Dec 15 '07 #4

brettl
P: 41
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.
Dec 18 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.