This topic is locked

FPDF error with grafik

5/5/2008 4:02:48 AM
PHPRunner General questions
rjks author

Hello Support,
well I finally got nearly everything working and need to change the PDF Export Output.
I have done a new function which works fine, until I try to put a graphic in the PDF.
I have tried in the header function
$this->image("isoft_logo.jpg",10,10,100,0,"JPG")
in the main function
$pdf->image("isoft_logo.jpg",10,10,100,0,"JPG")
both variants with a PNG file.
I always get the following error
Fatal error: Cannot pass parameter 5 by reference in C:\Inetpub\wwwroot\webroot\isoft\procedure\Invoice_export.php on line 1518
is this my problem or is it the FPDF Version used by PHPR?
When I print from the print friendly page created PDF there´s no problem with the graphics??
Need quick help on this.
Thanks in advance
Robert

J
Jane 5/5/2008

Hi,
it's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages or zip and send a full set of generated PHP files, your database creation script with sample data along with instructions on reproducing this error.

rjks author 5/6/2008

Morning Support,
I can´t load the Project to the demo site, its too big!
Is there another way??
Robert

J
Jane 5/6/2008

Robert,
zip and send a full set of generated PHP files, your database creation script with sample data along with instructions on reproducing this error to support@xlinesoft.com.

rjks author 5/7/2008

Hello again,
I solved the problem with the help of mrpebble, there is a problem with the Image function in fpdf.php, see below.

I tried your idea with the fonts but that didn´t seem to make any difference, then I started searching for the error "Fatal error: Cannot pass parameter 5 by reference in " and came across this article

Passing by reference
After looking in the fpdf.php code I found the Image function had a parameter with reference &$h

function Image($file,$x,$y,$w=0,&$h,$type=''.$link='')


I removed the reference i changed the parameter to $h=0 like this

function Image($file,$x,$y,$w=0,$h=0,$type=''.$link='')


After that no more problems, the Images are displayed exactly right.
Maybe you can use this, I´ll put a copy in the forum.
thanks again for the help, you put me on the right track.
Robert


Hi Support,
So that seems to be it, my graphics are working with this change, doe´s this mean that the fpdf.php will have to be altered or is it a PHP configuration problem.??
Robert

Alexey admin 5/8/2008

Robert,
try using this code in your files:

$height=0;

$this->image("isoft_logo.jpg",10,10,100,$height,"JPG")



I don't recommend you to modify Image function declaration header.