FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » PDF Generation & PHP 4.3.8 / PECL Package pdflib 2.0.2
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
PDF Generation & PHP 4.3.8 / PECL Package pdflib 2.0.2 [message #19959] Sun, 19 September 2004 21:58 Go to next message
jmccombs is currently offline  jmccombs   United States
Messages: 8
Registered: September 2004
Location: Northern Virginia
Karma: 0
Junior Member
Ran into a problem when I had pdf generation enabled. Seems that PDFs weren't being generated properly.

Errors were:
Warning: pdf_add_bookmark() expects exactly 4 parameters, 2 given in /portal/solutions/www/forum/fud/pdf.php on line 95

Warning: pdf_stringwidth() expects exactly 4 parameters, 2 given in /portal/solutions/www/forum/fud/pdf.php on line 157

Warning: pdf_stringwidth() expects exactly 4 parameters, 2 given in /portal/solutions/www/forum/fud/pdf.php on line 105

Warning: Division by zero in /portal/solutions/www/forum/fud/pdf.php on line 106

Warning: wordwrap(): Can't force cut when width is zero. in /portal/solutions/www/forum/fud/pdf.php on line 110

Warning: wordwrap(): Can't force cut when width is zero. in /portal/solutions/www/forum/fud/pdf.php on line 110

Warning: wordwrap(): Can't force cut when width is zero. in /portal/solutions/www/forum/fud/pdf.php on line 110

Warning: wordwrap(): Can't force cut when width is zero. in /portal/solutions/www/forum/fud/pdf.php on line 110

Warning: wordwrap(): Can't force cut when width is zero. in /portal/solutions/www/forum/fud/pdf.php on line 110

Warning: wordwrap(): Can't force cut when width is zero. in /portal/solutions/www/forum/fud/pdf.php on line 110

Warning: wordwrap(): Can't force cut when width is zero. in /portal/solutions/www/forum/fud/pdf.php on line 110

Warning: wordwrap(): Can't force cut when width is zero. in /portal/solutions/www/forum/fud/pdf.php on line 110

Warning: wordwrap(): Can't force cut when width is zero. in /portal/solutions/www/forum/fud/pdf.php on line 110

Warning: wordwrap(): Can't force cut when width is zero. in /portal/solutions/www/forum/fud/pdf.php on line 110

Warning: wordwrap(): Can't force cut when width is zero. in /portal/solutions/www/forum/fud/pdf.php on line 110

Warning: wordwrap(): Can't force cut when width is zero. in /portal/solutions/www/forum/fud/pdf.php on line 110

Warning: wordwrap(): Can't force cut when width is zero. in /portal/solutions/www/forum/fud/pdf.php on line 110

Warning: wordwrap(): Can't force cut when width is zero. in /portal/solutions/www/forum/fud/pdf.php on line 110

Warning: Cannot modify header information - headers already sent by (output started at /portal/solutions/www/forum/fud/pdf.php:95) in /portal/solutions/www/forum/fud/pdf.php on line 1549

Warning: Cannot modify header information - headers already sent by (output started at /portal/solutions/www/forum/fud/pdf.php:95) in /portal/solutions/www/forum/fud/pdf.php on line 1550

Warning: Cannot modify header information - headers already sent by (output started at /portal/solutions/www/forum/fud/pdf.php:95) in /portal/solutions/www/forum/fud/pdf.php on line 1551



So I had to make a few changes. Smile

on about line 95 of pdf.php:
pdf_add_bookmark($this->pdf, $ttl);


should be changed to:
pdf_add_bookmark($this->pdf, $ttl, 0, 0);


on about line 105 of pdf.php
$max_cpl = pdf_stringwidth($this->pdf, 'w');

should be changed to:
$max_cpl = pdf_stringwidth($this->pdf, 'w'. $this->fonts['Courier'], 12);


and on about like 157 of pdf.php:
$ow = pdf_get_value($this->pdf, 'textx', 0) - pdf_stringwidth($this->pdf, $caption);

should be changed to:
$ow = pdf_get_value($this->pdf, 'textx', 0) - pdf_stringwidth($this->pdf, $caption, $this->fonts['Courier'], 12);


not quite sure what the deal is, because those last two options to pdf_stringwidth() are only required under php-5. Might be beacuse I snagged the latest PDF PHP module (2.0.2 IIRc) before I tested this....

-j


Do pyromaniacs wear blazers?

[Updated on: Sun, 19 September 2004 22:02]

Report message to a moderator

Re: PDF Generation & PHP 4.3.8 / PECL Package pdflib 2.0.2 [message #19977 is a reply to message #19959] Mon, 20 September 2004 20:32 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The problem is that the pdf extension provided by the libpdf folks is not compatible with the one that comes in the PHP distribution. You should use the extension that comes with PHP natively.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Can't change settings in user CP(2.6.5RC3)
Next Topic: right management bewilderment
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 17:47:03 GMT 2024

Total time taken to generate the page: 0.02029 seconds