note 55690 added to function.pdf-open-file
| From: | Button dot Man at gmail dot com | Date: | Wed, 10 Aug 2005 16:39:58 +0000 |
| Subject: | note 55690 added to function.pdf-open-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93384@lists.php.net to get a copy of this message | ||
"Fatal error: PDFlib error: [2100] PDF_begin_page: Function must not be called in
'object' scope"
I found a solution for this fault:
when i got the fault, this was the script ->
<?php
$pdf = pdf_new();
pdf_open_file($pdf, "C:\web\pdf\test45.pdf");
pdf_begin_page($pdf, 595, 842);
pdf_set_font($pdf, "Times-Roman", 30, "host");
pdf_set_value($pdf, "textrendering", 1);
pdf_show_xy($pdf, "A PDF document is created!", 50, 750);
pdf_end_page($pdf);
pdf_close($pdf);
?>
but when i added some slashes to the path:
<?php
$pdf = pdf_new();
pdf_open_file($pdf, "C:\\web\\pdf\\test45.pdf");
pdf_begin_page($pdf, 595, 842);
pdf_set_font($pdf, "Times-Roman", 30, "host");
pdf_set_value($pdf, "textrendering", 1);
pdf_show_xy($pdf, "A PDF document is created!", 50, 750);
pdf_end_page($pdf);
pdf_close($pdf);
?>
there wasn't no fault anymore and the pdf-file was succesfully created
I think you guys get the point ( add 2 slashes )
Glenn
----
Manual Page -- http://www.php.net/manual/en/function.pdf-open-file.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55690
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55690&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55690&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55690&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55690&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55690&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55690&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55690&report=yes
Search -- http://master.php.net/manage/user-notes.php