|
 |
|
 |
 |
|
06-26-2007, 12:18 AM
|
#1 (permalink)
|
|
Salchester
Join Date: Jul 2005
Location: In a house
Posts: 230
|
PHP to PDF
Hiya Everyone,
How do I create the following page in a PDF document using PHP, and display the appropriate information in the red boxes?
http://www.freewebs.com/mail2go/PDF/Template.JPG
Many Thanks,
__________________
Many Thanks, in advance!
Salchester.
The Future Is Here - Are You Ready?
|
|
|
06-26-2007, 05:21 AM
|
#2 (permalink)
|
|
Senior Contributor
Join Date: Mar 2005
Posts: 635
|
__________________

UT: Ultra-kill... God like!
|
|
|
06-26-2007, 05:58 AM
|
#3 (permalink)
|
|
Salchester
Join Date: Jul 2005
Location: In a house
Posts: 230
|
Yes, But I don't know where to start, how do I create a simple PDF document that display the words "Testing Testing 1,2,3!!!"
Many Thanks,
__________________
Many Thanks, in advance!
Salchester.
The Future Is Here - Are You Ready?
|
|
|
06-26-2007, 06:54 AM
|
#4 (permalink)
|
|
Newbie
Join Date: Jun 2002
Location: Denmark
Posts: 1,680
|
- Read the link posted by DjM
- Click the link posted by DjM
- read the page that appears
- copy the appropriate example from that page
- alter it to fit your "testing 1.. 2.. 3.." display
- done.
Now wasn't that easy.
|
|
|
06-26-2007, 08:56 AM
|
#5 (permalink)
|
|
Salchester
Join Date: Jul 2005
Location: In a house
Posts: 230
|
PHP to PDF
Redhead,
I get the following error, when using the code below, why?
Fatal error: Call to undefined function PDF_begin_document() in C:\Documents and Settings\It's Dale\Desktop\PHP to PDF\xampplite\htdocs\PDF.php on line 5
Code:
<?php
$p = PDF_new();
/* open new PDF file; insert a file name to create the PDF on disk */
if (PDF_begin_document($p, "", "") == 0) {
die("Error: " . PDF_get_errmsg($p));
}
PDF_set_info($p, "Creator", "hello.php");
PDF_set_info($p, "Author", "Rainer Schaaf");
PDF_set_info($p, "Title", "Hello world (PHP)!");
PDF_begin_page_ext($p, 595, 842, "");
$font = PDF_load_font($p, "Helvetica-Bold", "winansi", "");
PDF_setfont($p, $font, 24.0);
PDF_set_text_pos($p, 50, 700);
PDF_show($p, "Hello world!");
PDF_continue_text($p, "(says PHP)");
PDF_end_page_ext($p, "");
PDF_end_document($p, "");
$buf = PDF_get_buffer($p);
$len = strlen($buf);
header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=hello.pdf");
print $buf;
PDF_delete($p);
?>
Many Thanks,
__________________
Many Thanks, in advance!
Salchester.
The Future Is Here - Are You Ready?
|
|
|
06-26-2007, 09:43 AM
|
#6 (permalink)
|
|
Newbie
Join Date: Jun 2002
Location: Denmark
Posts: 1,680
|
Perhaps you didnt do what I told you to do:
Quote:
- read the page that appears
|
Quote:
|
To get these functions to work in PHP < 4.3.9, you have to compile PHP with --with-pdflib[=DIR]. DIR is the PDFlib base install directory, defaults to /usr/local.
|
I recon you havn't got PDFlib installed.
Or perhaps you're running PHP-5 and using the PHP-4 example, once again I must direct you to
Quote:
- read the page that appears
|
|
|
|
06-26-2007, 12:24 PM
|
#7 (permalink)
|
|
Salchester
Join Date: Jul 2005
Location: In a house
Posts: 230
|
Quote:
Originally Posted by redhead
Perhaps you didnt do what I told you to do:
I recon you havn't got PDFlib installed.
Or perhaps you're running PHP-5 and using the PHP-4 example, once again I must direct you to
|
Redhead,
How do I know what version i'm running?
Many Thanks,
__________________
Many Thanks, in advance!
Salchester.
The Future Is Here - Are You Ready?
|
|
|
06-26-2007, 12:27 PM
|
#8 (permalink)
|
|
Senior Contributor
Join Date: Mar 2005
Posts: 635
|
__________________

UT: Ultra-kill... God like!
|
|
|
06-27-2007, 10:05 AM
|
#9 (permalink)
|
|
Salchester
Join Date: Jul 2005
Location: In a house
Posts: 230
|
PHP to PDF
DJMaze,
I have ran the following code, and have found out I'm am running PHP Version 5.2.1!
Code:
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);
?>
Though when I run the PDF code for PHP Version 5, I get "The page can not be displayed" error message. Why is this, is it because I don't have PDFlib installed? Where/How do I install it?
Many Thanks,
__________________
Many Thanks, in advance!
Salchester.
The Future Is Here - Are You Ready?
|
|
|
06-27-2007, 01:34 PM
|
#10 (permalink)
|
|
Java fanboy
Join Date: Aug 2003
Posts: 1,114
|
It sounds like you had a typo in the address of your web browser - if you had a PHP error, you'd see some sort debugging message.
|
|
|
06-27-2007, 02:55 PM
|
#11 (permalink)
|
|
Senior Contributor
Join Date: Mar 2005
Posts: 635
|
Ok now you sounded really dumb-ass Salchester and would be better off with default answers from your ISP call center like:
- is the powerline connected on both ends
- is the modem on
- is the computer on
- you see green lights
- restart windows
- restart windows again
- restart windows another time
- re-install windows
Since most "default" messages from just the plain browser you don't understand either, i will stop putting my effort in you and won't reply any longer.
Just ask the others.
__________________

UT: Ultra-kill... God like!
|
|
|
06-27-2007, 09:51 PM
|
#12 (permalink)
|
|
Salchester
Join Date: Jul 2005
Location: In a house
Posts: 230
|
PHP to PDF
DJMaze,
Oops, sorry my mistake, I accidentally entered the following as the address:
http://www.localhost.com/info.php/
Instead of:
localhost/info.php
Upon entering the above address, I still get greeted with the following error message:
Fatal error: Call to undefined function PDF_begin_document() in
C:\Documents and Settings\Dale Piper\Desktop\xampplite\htdocs\Info.php on line 5
Is this due to not having PDFlib installed? Where/How do I install it?
Many Thanks,
__________________
Many Thanks, in advance!
Salchester.
The Future Is Here - Are You Ready?
|
|
|
06-28-2007, 09:17 AM
|
#13 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,397
|
this is why people get fusterated with you salch.. you fire away questions without doing any thinking for yourself.
there's a big installation section on the links you have already been supplied. before you come back and say that you don't understand it, you'll probably have to click through to the pecl stuff and read about it , .. or read about compiling php. (a nightmare on windows btw)
__________________
testing 1 2 3
|
|
|
06-29-2007, 01:22 AM
|
#14 (permalink)
|
|
Java fanboy
Join Date: Aug 2003
Posts: 1,114
|
Well, by default the Windows install of PHP doesn't install much - all you should have to do is re-run the installer and choose the extensions you want to have available.
|
|
|
06-29-2007, 10:43 AM
|
#15 (permalink)
|
|
Salchester
Join Date: Jul 2005
Location: In a house
Posts: 230
|
PHP to PDF
Belisarius,
Where do I obtain the download?
Many Thanks,
__________________
Many Thanks, in advance!
Salchester.
The Future Is Here - Are You Ready?
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -8. The time now is 06:23 PM.
|
Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle
|
 |
|