Re: Sending a PDF page
| From: | Brad Pauly | Date: | Thu, 03 Jul 2003 19:47:41 +0000 |
| Subject: | Re: Sending a PDF page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-153921@lists.php.net to get a copy of this message | ||
Todd Cary wrote:
In this code:
if ($prtpdf) {
include "letter_new.php";
exit;
}
I create a PDF page, however I would like to continue within the script (not have the exit). If I do that, the PDF page is corrupted by the script code.
What is the best solution for this?
I am assuming that "letter_new.php" outputs the contents of the PDF you are generating. You could use output buffering to grab the PDF and then go on with your script:
if ($prtpdf) {
ob_start();
include "letter_new.php";
$pdf_buffer = ob_get_contents();
ob_end_clean();
}
http://us2.php.net/manual/en/ref.outcontrol.php
Brad