473,385 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

error while using pdf_new()

254 100+
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
1 2040
pbmods
5,821 Expert 4TB
Heya, mukeshrasm.

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

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

Similar topics

1
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I...
0
by: angel duran | last post by:
I'm new to php and i'm trying to print a table from my database with pdflib, but i always get this error: Fatal error: PDFlib error: PDF_findfont: Metrics data for font 'times-roman' not found in...
1
by: Amir | last post by:
Hi i wrote the following, which causes the script to terminate any help is greatly appreciated, thanks so much in advance! ======================= <?
5
by: Enos Meroka | last post by:
Hallo, I am a student doing my project in the university.. I have been trying to compile the program using HP -UX aCC compiler, however I keep on getting the following errors. ...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
9
by: JTrigger | last post by:
When I compile my project using the IDE on a development machine it works just fine. When I compile it on the server using csc.exe, I get the following error when I try to bring it up in the web...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
4
by: mukeshrasm | last post by:
<?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($pdf, "Courier", "host", 0);
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.