Hi there,

What I am about to describe was working at one point in the past, and for some reason 
has stopped.  Because it was working, I don't think its PHP.  I'll ask here at any 
rate.

I have a page displays a form to the user.  The information on this form is then used 
to generate a PDF file with GDlib.  Once the file is create, the script opens, and 
then I use the header() and passthru() commands to: first, tell the browser its an 
application/pdf mime type, and then to shove the info down the stream.

The problem I'm getting is that the Adobe slash screen comes up and initializes, but 
then the file never shows.  When I go and open the file by hand, it loads into Acrobat 
without mishap.

So,

1) The file is being created properly.
2) Adobe IS being loaded properly.
3) It appears the PASSTHRU is dieing on me prematurely.

Anyone else had troubles with this?
Comments PLEASE... I really like what I had going and now it just plum doesn't do 
anything.  <sigh>.

Partial code follows:
-----------------------------------------------------------------------------------------------
/////////////////////////////////////////////////////////

// Print PREPAID

/////////////////////////////////////////////////////////

if($prepaid == "1") {

pdf_show_xy($pdf, "Enclose prepaid return", 396-(pdf_stringwidth($pdf, "Enclose 
prepaid return")+27), 509);

}


//////////////////////////////////////////////////////////

// End the document

//////////////////////////////////////////////////////////


pdf_end_page($pdf);

pdf_close($pdf);

fclose($fp);


//////////////////////////////////////////////////////////

// Display the file to the user

//////////////////////////////////////////////////////////


header("Content-type: application/pdf");


$fp = fopen($Name.".pdf", "r");

fpassthru($fp);

fclose($fp);


///////////////////////////////////////////////////////////

// Delete the file from the web server

///////////////////////////////////////////////////////////

unlink($Name.".pdf");

}


?>

Reply via email to