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

error while using pdf_new()

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. ?>
  25.  
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+
1 Reply


pbmods
Expert 5K+
P: 5,821
Heya, mukeshrasm.

You're probably getting this error because you don't have the PDF Extension installed.
Dec 23 '07 #2

Post your reply

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