Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Go Back   Code Forums > Application and Web Development > PHP
User Name
Password

Reply
 
LinkBack Thread Tools Display Modes
Old 06-26-2007, 12:18 AM   #1 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
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?
Salchester is offline   Reply With Quote
Old 06-26-2007, 05:21 AM   #2 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 635
DJMaze is on a distinguished road
Did you read PHP: PDF Functions - Manual
__________________

UT: Ultra-kill... God like!
DJMaze is offline   Reply With Quote
Old 06-26-2007, 05:58 AM   #3 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
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?
Salchester is offline   Reply With Quote
Old 06-26-2007, 06:54 AM   #4 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,680
redhead is on a distinguished road
  • 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.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 06-26-2007, 08:56 AM   #5 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
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?
Salchester is offline   Reply With Quote
Old 06-26-2007, 09:43 AM   #6 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,680
redhead is on a distinguished road
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
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 06-26-2007, 12:24 PM   #7 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
Quote:
Originally Posted by redhead View Post
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?
Salchester is offline   Reply With Quote
Old 06-26-2007, 12:27 PM   #8 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 635
DJMaze is on a distinguished road
PHP: phpinfo - Manual
__________________

UT: Ultra-kill... God like!
DJMaze is offline   Reply With Quote
Old 06-27-2007, 10:05 AM   #9 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
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?
Salchester is offline   Reply With Quote
Old 06-27-2007, 01:34 PM   #10 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,114
Belisarius is on a distinguished road
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.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 06-27-2007, 02:55 PM   #11 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 635
DJMaze is on a distinguished road
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!
DJMaze is offline   Reply With Quote
Old 06-27-2007, 09:51 PM   #12 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
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?
Salchester is offline   Reply With Quote
Old 06-28-2007, 09:17 AM   #13 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
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
sde is offline   Reply With Quote
Old 06-29-2007, 01:22 AM   #14 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,114
Belisarius is on a distinguished road
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.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 06-29-2007, 10:43 AM   #15 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
PHP to PDF

Belisarius,

Where do I obtain the download?

Many Thanks,
__________________
Many Thanks, in advance!

Salchester.
The Future Is Here - Are You Ready?
Salchester is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make a search engine for your website with PHP zhisede PHP 3 10-25-2005 07:54 AM
PHP 5.0.4 and 4.3.11 Released sde Code Newbie News 0 04-20-2005 10:56 AM
PHP to Flash control panel roccoman PHP 1 11-24-2004 08:10 AM
PHP vs .NET Redline Lounge 1 11-24-2004 06:10 AM
I need to learn PHP Nitro PHP 9 06-28-2003 11:24 AM


All times are GMT -8. The time now is 06:23 PM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle