Connection dropped on pdf_set_font()
| From: | Colin Putney | Date: | Fri, 10 Mar 2000 02:51:47 +0000 |
| Subject: | Connection dropped on pdf_set_font() | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-11843@lists.php.net to get a copy of this message | ||
Anybody have any idea what could be causing this?
I've verified that Apache is not crashing. I ran a test script with gdb
attached, hoping to get a backtrace, but httpd finishes the request
gracefully and processes subsequent requests (for other scripts) with
no problems.
I'm using apache 1.3.12, php4b4pl1, and pdflib 3.0:
./configure \
--with-apache=/opt/pd/apache_1.3.12 \
--with-mysql=/usr/local/mysql \
--with-pdflib=/usr/local \
--with-png-dir=/opt/pd/libpng-1.0.5 \
--enable-sysvshm=yes \
--enable-sysvsem=yes \
--enable-debug=no \
--enable-track-vars=yes \
--enable-magic-quotes=no \
--enable-debugger=yes \
--with-imap=/opt/pd/imap-4.7/c-client \
--with-ldap=/usr/local \
--with-regex=apache \
--with-config-file-path=/web/apache/conf
The test script below produces "setting font...", but seemingly never
returns from the call to pdf_set_font().
<?php
// define constants
define(TMP_FILE,"/tmp/test.pdf");
// convert inches to Postscript points
$page_width = 8.5 * 72;
$page_height = 11 * 72;
$page_margin = 0.5 * 72;
// open pdf file
$fp = fopen(TMP_FILE,"w");
$pdf = PDF_open($fp);
// open page
pdf_begin_page($pdf, $page_width, $page_height);
pdf_add_outline($pdf, "Test Page");
// set font
echo("setting font..."); flush();
pdf_set_font($pdf, "Times-Roman", 12, 4);
echo("done.<br>\n"); flush();
// draw some text
$x = $page_width - $page_margin - pdf_stringwidth($pdf, "PDF Test
Page");
$y = $page_height - $page_margin - 12;
pdf_show_xy($pdf, "PDF Test Page", $x, $y);
// close page
PDF_end_page($pdf);
// close open files
PDF_close($pdf);
fclose($fp);
// Let browser know what's coming
header("Content-type: application/pdf");
// send PDF data
readfile(TMP_FILE);
// delete temporary file
unlink(TMP_FILE);
?>
--------------------------------------------------
Colin Putney 604-932-0606 x21
Bit Flinger colin@whistler.net
Whistler Networks http://www.whistler.net/