<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.3959" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2>Ok, tried that, here
is the code that I used:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> $certLogo =
"logo.gif";</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR> $pdf = pdf_new();<BR>
pdf_open_file($pdf, $filename);<BR> $font = pdf_findfont($pdf,
"Helvetica", "host", 0);</DIV>
<DIV> </DIV>
<DIV> pdf_begin_page($pdf, 595, 842);</DIV>
<DIV> </DIV>
<DIV><BR> $image = $pdf->load_image("auto", $certLogo, "");
<BR> $pdf->fit_image($image, 390,575,
"");<BR> $pdf->close_image($image);</DIV>
<DIV> </DIV>
<DIV><BR> pdf_setfont($pdf, $font, 10);</DIV>
<DIV> </DIV>
<DIV> pdf_show_xy($pdf, "Invoice: " . $invoice, 350,
750);<BR></DIV>
<DIV>//more lines of text</DIV>
<DIV> </DIV></FONT><FONT face=Arial size=2>
<DIV><BR> pdf_end_page($pdf);<BR>
pdf_close($pdf); <BR> </DIV>
<DIV></FONT> </DIV>
<DIV><FONT face=Arial size=2>Here is the error message I got:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>PHP Fatal error: Call to a member function
load_image() on a non-object</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The gif file is in the same directory as the php
script file. Any ideas?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Daniel</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>----- Original Message ----- </FONT>
<DIV><FONT face=Arial size=2>From: "Tim Carpenter" <</FONT><A
href="mailto:Tim@gaiaresources.com.au"><FONT face=Arial
size=2>Tim@gaiaresources.com.au</FONT></A><FONT face=Arial
size=2>></FONT></DIV>
<DIV><FONT face=Arial size=2>To: "PHP users in Western Australia (or nearby)"
<</FONT><A href="mailto:phpwestoz@lists.linux.org.au"><FONT face=Arial
size=2>phpwestoz@lists.linux.org.au</FONT></A><FONT face=Arial
size=2>></FONT></DIV>
<DIV><FONT face=Arial size=2>Sent: Saturday, July 12, 2008 11:36 PM</FONT></DIV>
<DIV><FONT face=Arial size=2>Subject: Re: [PHPwestoz] PHP
problem</FONT></DIV></DIV>
<DIV><FONT face=Arial><BR><FONT size=2></FONT></FONT></DIV><FONT face=Arial
size=2>Hi, <BR><BR>You have to open the image using pdf_load_image first, pass
the result of that as the second parameter of pdf_fit_image.<BR><BR></FONT><A
href="http://au.php.net/manual/en/function.pdf-load-image.php"><FONT face=Arial
size=2>http://au.php.net/manual/en/function.pdf-load-image.php</FONT></A><BR><BR><FONT
face=Arial size=2>Tim<BR><BR><BR>-----Original Message-----<BR>From: </FONT><A
href="mailto:phpwestoz-bounces@lists.linux.org.au"><FONT face=Arial
size=2>phpwestoz-bounces@lists.linux.org.au</FONT></A><FONT face=Arial size=2>
on behalf of Daniel Antonic<BR>Sent: Sat 12/07/2008 10:48 PM<BR>To: </FONT><A
href="mailto:phpwestoz@lists.linux.org.au"><FONT face=Arial
size=2>phpwestoz@lists.linux.org.au</FONT></A><BR><FONT face=Arial
size=2>Subject: [PHPwestoz] PHP problem<BR> <BR>Ok guys, here is the
problem I have.<BR><BR>I'm Using Apache 1.3 and PHP 5.2. I'm writing my own
invoicing program, and it needs to generate PDF invoices, and save them to a
file. I've got it inserting text fine, but I've got all sorts of trouble
inserting pictures.<BR><BR>The code that I'm using is as
follows:<BR><BR><BR> $pdf = pdf_new();<BR>
pdf_open_file($pdf, $filename);<BR> $font = pdf_findfont($pdf,
"Helvetica", "host", 0);<BR><BR> pdf_begin_page($pdf, 595,
842);<BR><BR>//PDF_fit_image ( $pdf, "logo.gif", 10, 10, "scale 0.5" ) removed
this line for script to run<BR><BR> pdf_setfont($pdf, $font,
10);<BR><BR> pdf_show_xy($pdf, "Invoice: " . $invoice, 350,
750);<BR><BR>//extra lines go in here<BR><BR>
pdf_end_page($pdf);<BR> pdf_close($pdf);
<BR><BR>I've used pdf_fit_image() and gotten the following error:
pdf_fit_image() expects parameter 2 to be long, string given, had to remove the
line for the script to run.<BR><BR>I'm not sure what is going wrong, any help
would be great.<BR><BR>Kind regards, <BR>Daniel Antonic <BR>Proprietor DCN
Solutions <BR><BR>Mob: 0438 303 429 <BR>Web: dcnsolutions.net<BR><BR><BR><BR>No
virus found in this incoming message.<BR>Checked by AVG - </FONT><A
href="http://www.avg.com"><FONT face=Arial
size=2>http://www.avg.com</FONT></A><FONT face=Arial size=2> <BR>Version:
8.0.138 / Virus Database: 270.4.9/1548 - Release Date: 12/07/2008 7:40
AM<BR><BR></FONT>
<P></P><FONT face=Arial size=2>
<HR>
</FONT>
<P></P><FONT face=Arial size=2>>
_______________________________________________<BR>> PHPwestoz mailing
list<BR>> </FONT><A href="mailto:PHPwestoz@lists.linux.org.au"><FONT
face=Arial size=2>PHPwestoz@lists.linux.org.au</FONT></A><BR><FONT face=Arial
size=2>> </FONT><A href="http://lists.linux.org.au/listinfo/phpwestoz"><FONT
face=Arial
size=2>http://lists.linux.org.au/listinfo/phpwestoz</FONT></A><BR><FONT
face=Arial size=2>></FONT></BODY></HTML>