[PHPwestoz] PHP problem
Tim at gaiaresources.com.au
Sun Jul 13 01:36:00 EST 2008
You have to open the image using pdf_load_image first, pass the result of that as the second parameter of pdf_fit_image.
From: phpwestoz-bounces at lists.linux.org.au on behalf of Daniel Antonic
Sent: Sat 12/07/2008 10:48 PM
To: phpwestoz at lists.linux.org.au
Subject: [PHPwestoz] PHP problem
Ok guys, here is the problem I have.
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.
The code that I'm using is as follows:
$pdf = pdf_new();
$font = pdf_findfont($pdf, "Helvetica", "host", 0);
pdf_begin_page($pdf, 595, 842);
//PDF_fit_image ( $pdf, "logo.gif", 10, 10, "scale 0.5" ) removed this line for script to run
pdf_setfont($pdf, $font, 10);
pdf_show_xy($pdf, "Invoice: " . $invoice, 350, 750);
//extra lines go in here
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.
I'm not sure what is going wrong, any help would be great.
Proprietor DCN Solutions
Mob: 0438 303 429
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 3264 bytes
Desc: not available
Url : http://lists.linux.org.au/pipermail/phpwestoz/attachments/20080712/618128da/attachment.bin
More information about the PHPwestoz