I have PHP5 installed, but when i try to open a script with a PDflib the one that come with the installation of PHP. I always get gibberish or this warning:
Do you want to download this file?
Name: noname_php?DBGSESSID=-1
Type: Adobe Acrobat for Active X, 1.00 KB
From: Localhost
When I click ok or save I got this error:
Internet Explorer was not able to open this site the requestis either unavailable or cannot be found.
I've checked the php_info file and it shows that PDFlib is working.
Also I'm including the script I'm trying to run and my system information
I'm running the following:
Windows XP SP2
Apache 2.0.50
PHP 5.02
<?php
$page_width = 576;
$page_height = 360;
$str = "Hello World!";
$creator = "helloworld.php";
$p = PDF_new ();
PDF_open_file ($p,"");
PDF_set_info ($p, "Creator", $creator);
PDF_set_info ($p, "Title", $str);
PDF_begin_page ($p, $page_width, $page_height);
$font = PDF_findfont ($p, "Helvetica-Bold", "host", 0);
$text_size = 18.0;
$strwidth = PDF_stringwidth ($p, $str, $font, $text_size);
$text_hpos = ($page_width / 2) - (floor ($strwidth / 2));
$text_vpos = ($page_height / 2) - (floor ($text_size / 2));
PDF_setfont ($p, $font, $text_size);
PDF_set_text_pos ($p, $text_hpos, $text_vpos);
PDF_show ($p, $str);
PDF_end_page ($p);
PDF_close ($p);
$buf = PDF_get_buffer ($p);
$len = strlen ($buf);
header ("Content-Type: application/pdf");
header ("Content-Length: $len");
header ("Content-Disposition: inline; filename=hello_world.pdf");
print $buf;
PDF_delete($p);
?>
Any help would be greatly appreciated
Thank you
Do you want to download this file?
Name: noname_php?DBGSESSID=-1
Type: Adobe Acrobat for Active X, 1.00 KB
From: Localhost
When I click ok or save I got this error:
Internet Explorer was not able to open this site the requestis either unavailable or cannot be found.
I've checked the php_info file and it shows that PDFlib is working.
Also I'm including the script I'm trying to run and my system information
I'm running the following:
Windows XP SP2
Apache 2.0.50
PHP 5.02
<?php
$page_width = 576;
$page_height = 360;
$str = "Hello World!";
$creator = "helloworld.php";
$p = PDF_new ();
PDF_open_file ($p,"");
PDF_set_info ($p, "Creator", $creator);
PDF_set_info ($p, "Title", $str);
PDF_begin_page ($p, $page_width, $page_height);
$font = PDF_findfont ($p, "Helvetica-Bold", "host", 0);
$text_size = 18.0;
$strwidth = PDF_stringwidth ($p, $str, $font, $text_size);
$text_hpos = ($page_width / 2) - (floor ($strwidth / 2));
$text_vpos = ($page_height / 2) - (floor ($text_size / 2));
PDF_setfont ($p, $font, $text_size);
PDF_set_text_pos ($p, $text_hpos, $text_vpos);
PDF_show ($p, $str);
PDF_end_page ($p);
PDF_close ($p);
$buf = PDF_get_buffer ($p);
$len = strlen ($buf);
header ("Content-Type: application/pdf");
header ("Content-Length: $len");
header ("Content-Disposition: inline; filename=hello_world.pdf");
print $buf;
PDF_delete($p);
?>
Any help would be greatly appreciated
Thank you