readthefuckingmanual.net

[SOLVED] Call to undefined function PDF_begin_document()

Error added: 2006-06-05T07:10:29Z

2 people waiting for the answer...

5 answers found.

Answer 254 (83.33333% helpful)

PDF_begin_document() function is deprecated since PDFlib version 6.we cant access the function in lower version.so try the program as below.

<?php

$p =pdf_new();
pdf_open_file($p,\"test.pdf\");

pdf_set_info($p, \"Creator\", \"hello.php\");
pdf_set_info($p, \"Author\", \"Rainer Schaaf\");
pdf_set_info($p, \"Title\", \"Hello world (PHP)!\");
pdf_begin_page($p, 595, 842);

$font = pdf_findfont($p, \"Helvetica-Bold\", \"winansi\", \"\");

pdf_setfont($p, $font, 10);
pdf_set_text_pos($p, 50, 700);
pdf_show($p, \"Hello world!\");
pdf_continue_text($p, \"(says PHP)\");
pdf_end_page($p);


$buf = pdf_get_buffer($p);
$len = strlen($buf);

header(\"Content-type: application/pdf\");
header(\"Content-Length: $len\");
header(\"Content-Disposition: inline; filename=hello.pdf\");
print $buf;
echo $buf;

pdf_delete($p);
?> 
Permalink

Answer 364 (0.0% helpful)

Same problem is faced by me.
I think, this is version problem of PHP/Apache as LIBPDF is also installed.
Permalink

Answer 542 (0.0% helpful)

\'PDFlibException\' with message \'Don\'t fetch buffer 
Permalink

Answer 591 (0.0% helpful)

tertertert
Permalink

Answer 846 (0.0% helpful)

<a href=\"http://www.google.com/search?client=opera&rls=en&q=libpdf+solution&sourceid=opera&ie=utf-8&oe=utf-8\">google search for libpdf solution</a>
Permalink

Add an answer/solution

If you know the answer, please add your own solution below.
If you don't know, but find out later, please come back and share your answer - there will be other people struggling with this too.


Please enter 61948 here

If you want to be notified via email when this is solved, enter your email address here: