PDF creation error in 1.5.2 Wrong parameter count for class_

Joomla version 1.5 is end-of-life and are no longer supported. Please use Joomla 3.x instead.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
jimlad
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Mar 24, 2008 11:02 pm

PDF creation error in 1.5.2 Wrong parameter count for class_

Post by jimlad » Mon Mar 24, 2008 11:08 pm

Warning: Wrong parameter count for class_exists() in /home/sites/mydomain.org/public_html/libraries/tcpdf/tcpdf.php on line 96
I get this error when I hit a pdf creation icon in any article - followed by garbage text in the pdf window which seems to start with a pdf header as follows:
%PDF-1.5 3 0 obj <> endobj 4 0 obj <> stream xœTÁnÛ0 å9_ÁÛ6 PeÅŠã64‚
It was working fine in 1.5.0

I upgraded from 1.5.0 to 1.5.2 recently. I since uploaded as a 'patch' set of 'clean' 1.5.2 files (to see if I had a dodgy file in there) - still the same error persists

Everything else is working OK

Only addons are:
JCE editor
FCK editor

Any help or insight would be very welcome

Cheers

Jim
Last edited by jimlad on Mon Mar 24, 2008 11:47 pm, edited 1 time in total.

jimlad
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Mar 24, 2008 11:02 pm

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by jimlad » Mon Mar 24, 2008 11:24 pm

Has this anything to do with it?

I also got an image error, similar to that described in the article referenced below

http://www.thomassteven.com/joomla/53-j ... 5-pdf.html

He suggests some issues with the library version used in the 1.5.x releases - but I see that the i.5.2 library set is very recent...

My error is
Warning: getimagesize(http://www.mydomain.org/images/stories/red.jpg) [function.getimagesize]: failed to open stream: Connection refused in /home/sites/mydomain.org/public_html/libraries/tcpdf/tcpdf.php on line 3672
TCPDF error: Missing or incorrect image file: http://www.mydomain.org/images/stories/red.jpg
Trust me, the image is there...
Last edited by jimlad on Mon Mar 24, 2008 11:43 pm, edited 2 times in total.

spadilla
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Tue Dec 05, 2006 11:01 pm

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by spadilla » Mon Mar 24, 2008 11:28 pm

Same exact error here. Sorry I don;t have any better input other than to say you aren't alone!

jimlad
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Mar 24, 2008 11:02 pm

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by jimlad » Tue Mar 25, 2008 12:18 am

I went back and checked a 1.5.0 version of my site (was migrated from 1.x) and it is doing intermittent pdf errors - only saw this by trying a pdf of everything on the site...

Plain text - generally OK

GIF images on page - more get errors

Here are some errors generated in the pdf popup window after clicking the pdf icon in an article, off a text-only page in an otherwise fine version of a 1.5.0 site
Warning: addfont(/home/sites/mydomain.org/public_html/language/pdf_fonts/arial.php) [function.addfont]: failed to open stream: No such file or directory in /home/sites/mydomain.org/public_html/libraries/tcpdf/tcpdf.php on line 1661

Warning: addfont(/home/sites/mydomain.org/public_html/language/pdf_fonts/arial.php) [function.addfont]: failed to open stream: No such file or directory in /home/sites/mydomain.org/public_html/libraries/tcpdf/tcpdf.php on line 1661

Warning: addfont() [function.include]: Failed opening '/home/sites/mydomain.org/public_html/language/pdf_fonts/arial.php' for inclusion (include_path='.:/usr/share/pear') in /home/sites/mydomain.org/public_html/libraries/tcpdf/tcpdf.php on line 1661
TCPDF error: Could not include font definition file
I checked in ../languages/pdf_fonts/arial.php in the distribution 1.5.0 and 1.5.2 packages and the file arial.php is not there in the distribution.

What is referencing arial.php?

Now really unsure about what is going on here

spadilla
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Tue Dec 05, 2006 11:01 pm

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by spadilla » Tue Mar 25, 2008 12:26 am

My specific error:
Warning: Wrong parameter count for class_exists() in /libraries/tcpdf/tcpdf.php on line 96

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 2949120 bytes) in /libraries/tcpdf/unicode_data.php on line 16467
The memory size thing is pretty odd. I haven't seen that one before.

jimlad
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Mar 24, 2008 11:02 pm

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by jimlad » Tue Mar 25, 2008 12:32 am

Make a php.ini file and put the following in it, and place it in the joomla directory

memory_limit=16M

This usually sorts out the memory problem on many hosts/servers eg when installing a component with FTP off.

spadilla
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Tue Dec 05, 2006 11:01 pm

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by spadilla » Tue Mar 25, 2008 12:51 am

Thank you jimlad! I really thought I already had done that for this site. I appreciate your help :)

So now it just gives me the other error with a whole bunch of strange characters below it.

spelofske
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Mar 26, 2008 9:03 pm

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by spelofske » Wed Mar 26, 2008 9:10 pm

I'm receiving the same "tcpdf.php on line 96" error followed by lines of symbols beginning with "%PDF-1.5 3 0 obj <> endobj 4 0 obj <> stream". This happens on all pages regardless of font or graphics (or lack thereof).

I'm currently running 1.5.2. Anyone have any luck backing down to a previous version?

zacheos
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu Mar 27, 2008 1:48 pm

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by zacheos » Thu Mar 27, 2008 2:47 pm

I am also having this same problem...

This is what my page look like after trying to create a PDF:
Warning: Wrong parameter count for class_exists() in /home/eosdesig/public_html/cms/libraries/tcpdf/tcpdf.php on line 96
%PDF-1.5 3 0 obj <> endobj 4 0 obj <> stream x��X�o�F���ۧ�RL6��T]�wm�^u��ԇ��A1�'���w�YX�(��3��|���j�s}��|1��g���e�o?����X/�����V��m�iqz�P/����2����R�ڪX�TAwZ�N��4O�*R?��^>�,���
I looked into the tcpdf/tcpdf.php file on line 96 and this got me to look into the tcpdf/config/tcpdf_config.php file, and it appears that file is not correctly configured.

I am going to play with it a little bit and see what I get.

zacheos
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu Mar 27, 2008 1:48 pm

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by zacheos » Thu Mar 27, 2008 3:03 pm

Ok, by setting up the correct paths in the tcpdf/config/tcpdf_config.php file, I am still getting the error.

I now believe this may have something to do with fonts, as there is no fonts directory located in the tcpdf/ archive.

The tcpdf_config.php references a fonts/ archive that should be present, since it is not there, I am assuming that is a problem.

I have seen posts indicating the the 1.5.0 Joomla! worked correctly, but I do not have these files. If someone with the 1.5.0 build files could verify my assumptions that would be fantastic.

zacheos
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu Mar 27, 2008 1:48 pm

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by zacheos » Thu Mar 27, 2008 3:32 pm

Well... All of this has gotten me nowhere. I added the needed fonts archive and still no luck.

So, I am now changing my theory to PHP problems.

It looks like the script is actually a class for PHP 5 - meaning that those of us with 4.4 .4 may be out of luck.

Can anyone with Joomla! confirm this please?

I have looked into the creator of the class and it appears there is a version for PHP 4 - I am going to work with that now and report my success (or lack thereof).

spadilla
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Tue Dec 05, 2006 11:01 pm

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by spadilla » Thu Mar 27, 2008 3:45 pm

Thank you Zacheos for trying. This is really frustrating!

zacheos
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu Mar 27, 2008 1:48 pm

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by zacheos » Thu Mar 27, 2008 3:47 pm

BINGO BANGO BONGO

PROBLEM SOLVED...

If you are running PHP 4 - the packaged PDF conversion classes will not work in Joomla! 1.5.2

To solve this problem:

1.) Visit: http://sourceforge.net/projects/tcpdf/
2.) Download the class package for PDF 4
3.) Delete the existing files and sub folders in /libraries/tcpdf/ of your Joomla! installation
4.) Upload the version 4 class files that you got from SourceForge in the /libraries/tcpdf/ folder on your server
5.) Edit the tcpdf_config.php file in the /libraries/tcpdf/config/ folder on your server
5.a.) You will need to change the root path to the /tcpdf/ folder as well as the URL path to this folder

6.) Sit back and have a beer, life just got a whole lot better 8)

mobileguy
Joomla! Intern
Joomla! Intern
Posts: 76
Joined: Sat Jan 05, 2008 3:23 am
Contact:

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by mobileguy » Fri Mar 28, 2008 5:11 am

Hello

We are getting closer to a fix for this issues.

I found this step not necessary
5.a.) You will need to change the root path to the /tcpdf/ folder as well as the URL path to this folder

FF and Safari works in ie7 does not - still need to right click and open in a new tab. :'(

PS I am still the same after doing the above by just removing Wrong parameter count for class_exists() without having to upload all those files.

Also they are all going to get overwritten I presume on the next patch upgrade and we should get this logged as bug so the developers can fix it.

This may be a duplicate as there is so many bugs listed for pdf issues

[#10377] 1.5.2 upgrade viewing a pdf class error tcpdf.php on line 96

[#10324] TCPDF broke on PHP4 in 1.5.2

[#10271] Useless code in libraries\joomla\document\pdf\pdf.php

mobileguy
Joomla! Intern
Joomla! Intern
Posts: 76
Joined: Sat Jan 05, 2008 3:23 am
Contact:

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by mobileguy » Fri Mar 28, 2008 8:26 pm

Trying to find orig bug number as you get non helpful reply like below.

You would think they would actually tell you the bug number so you could look it up???
(search is not helpful and honestly causes duplicates as it simply one of the worst search there is.)
Submitted By: Elin Waring
Adddate: 2008-03-29 02:37:21
This is a duplicate of two previous confirmed reports. Please search prior to
submitting a new issue.

mobileguy
Joomla! Intern
Joomla! Intern
Posts: 76
Joined: Sat Jan 05, 2008 3:23 am
Contact:

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by mobileguy » Fri Mar 28, 2008 8:45 pm

After spending rather large amount of time on http://joomlacode.org/gf/search/

There is this confirmed bug

[#10323] Wrong parameter count for class_exists()

tor-3070
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Thu Feb 01, 2007 2:39 pm

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by tor-3070 » Sat Mar 29, 2008 11:41 am

De oplossing voor deze bug is eenvoudig, verander lijn 96 in
libraries/tcpdf/tcpdf.php van :

Code: Select all

   if(!class_exists(`TCPDF', false)) {
naar

Code: Select all

   if(!class_exists(`TCPDF')) {
Dit lost je probleem op in PHP4.


Thanks to Johan Janssens ;)

mobileguy
Joomla! Intern
Joomla! Intern
Posts: 76
Joined: Sat Jan 05, 2008 3:23 am
Contact:

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by mobileguy » Sat Mar 29, 2008 7:44 pm

That fix does not work Im afraid.

There is more to it that the class issue.

mobileguy
Joomla! Intern
Joomla! Intern
Posts: 76
Joined: Sat Jan 05, 2008 3:23 am
Contact:

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by mobileguy » Sat Mar 29, 2008 7:57 pm

I have updated bug [#10323] Wrong parameter count for class_exists() still as not working.

http://joomlacode.org/gf/project/joomla ... m_id=10323

If the changes in the bug and highlighted above are made

Code: Select all

Parse error: parse error, unexpected '=', expecting '}' in /libraries/tcpdf/tcpdf.php on line 923

User avatar
tfuller
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 218
Joined: Tue Sep 20, 2005 11:30 pm
Location: Oregon
Contact:

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by tfuller » Fri Apr 18, 2008 5:42 pm

I have two sites running 1.5.2. One gets the class error on pdf generation, the other does not.

Server where pdf generation works:

PHP Built on: Linux music.mediacampus.com 2.6.9-67.0.4.EL #1 Sun Feb 3 06:50:13 EST 2008 x86_64
Database Version: 4.1.20-log
Database Collation: utf8_general_ci
PHP Version: 4.3.9
Web Server: Apache/2.0.52 (CentOS)
Web Server to PHP interface: apache2handler
Joomla! Version: Joomla! 1.5.2 Production/Stable [ Woi ] 22-March-2008 22:00 GMT
User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14

Server were pdf throws up the count class error:

PHP Built on: Linux infong 2.4 #1 SMP Wed Sep 26 00:19:50 CEST 2007 i686 GNU/Linux
Database Version: 5.0.51-log
Database Collation: utf8_general_ci
PHP Version: 4.4.8
Web Server: Apache/1.3.34 Ben-SSL/1.55
Web Server to PHP interface: cgi
Joomla! Version: Joomla! 1.5.2 Production/Stable [ Woi ] 22-March-2008 22:00 GMT
User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Author of component Joomla Bible Study:
http://www.JoomlaBibleStudy.org

User avatar
grafixpro
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Mon Feb 27, 2006 9:50 pm

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by grafixpro » Mon Apr 21, 2008 5:24 pm

Same problem here. Just trying to keep the post fresh.

PHP Built on: Linux gator194.hostgator.com 2.6.24.3-grsec #5 SMP Thu Mar 13 00:20:19 CDT 2008 i686
Database Version: 4.1.22-standard
Database Collation: utf8_general_ci
PHP Version: 4.4.4
Web Server: Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a PHP-CGI/0.1b
Web Server to PHP interface: cgi
Joomla! Version: Joomla! 1.5.2 Production/Stable [ Woi ] 22-March-2008 22:00 GMT
User Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
I searched first, I swear I did...

J3.9+ / PHP Version 7.1 / Linux 2.6.32 / Apache/2.4.33 / MySQLi 5.6.43
/G\

mobileguy
Joomla! Intern
Joomla! Intern
Posts: 76
Joined: Sat Jan 05, 2008 3:23 am
Contact:

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by mobileguy » Mon Apr 21, 2008 6:04 pm

Me too

I do notice that I included run on php vers 4

I have other issues with some ext and those developers said sorry only support php vers 5

I'm waiting on my host to upgrade to php vers 5

Is this then a php 4 issue?? and we need to upgrade to php vers 5??

User avatar
tfuller
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 218
Joined: Tue Sep 20, 2005 11:30 pm
Location: Oregon
Contact:

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by tfuller » Mon Apr 21, 2008 6:38 pm

I'm not sure its just a php versioning problem. I have two sites, both using a version of php 4x - on one of them the pdf generation works, on the other it doesn't.
Author of component Joomla Bible Study:
http://www.JoomlaBibleStudy.org

montana1329
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Wed Apr 02, 2008 6:26 am

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by montana1329 » Wed Apr 23, 2008 5:33 am

Glad I'm not the only one with this problem.

more_q_than_a
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Apr 15, 2008 2:33 am

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by more_q_than_a » Thu Apr 24, 2008 8:17 pm

I would submit its not a php version issue.
I'm now using php5 and the error is still occuring, therefore it appears it's the pdf ver / code.

the post above might be the fix (at least short until update / patch) I'll post back after with my result.
John

you know your in trouble when you have more q's than a's

montana1329
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Wed Apr 02, 2008 6:26 am

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by montana1329 » Fri Apr 25, 2008 6:08 am

Sweet!
Just installed the new 1.5.3 and it fixed the PDF problem immediately!
Nicely done Joomla programmers!
Thanks!

User avatar
tfuller
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 218
Joined: Tue Sep 20, 2005 11:30 pm
Location: Oregon
Contact:

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by tfuller » Fri Apr 25, 2008 3:31 pm

1.5.3 does seem to have fixed the pdf problem. Awesome guys!
Author of component Joomla Bible Study:
http://www.JoomlaBibleStudy.org

ohlavache
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Sat Nov 11, 2006 11:55 am

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by ohlavache » Fri Apr 25, 2008 10:18 pm

Unfortunately the pdf problem hasn't been fixed for me in J!1.5.3

I click on the pdf link/icon and a duplicate page opens in a new browser window. :(

Anybody got any ideas?

Thanks,

Ej

User avatar
tfuller
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 218
Joined: Tue Sep 20, 2005 11:30 pm
Location: Oregon
Contact:

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by tfuller » Fri Apr 25, 2008 10:30 pm

I did notice that the pdf opens in a new FireFox tab, rather than a new window but it does appear correctly in pdf format now.
Author of component Joomla Bible Study:
http://www.JoomlaBibleStudy.org

krisper
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Wed Apr 16, 2008 8:17 pm

Re: PDF creation error in 1.5.2 Wrong parameter count for class_

Post by krisper » Mon Apr 28, 2008 9:15 pm

Hi,

I am running the same site on Xaamp locally and on live server with J1.5.2. On local the PDF button works perfectly.

However, on the live server I egt the same error msgs as everyone above. I have also tried the proposed solution but it did not work.

The live server runs PHP 4.4, the local PHP5.2.5.

How can this be fixed? Shall I wait for a fix in J1.5.3?

Tahnks!


Locked

Return to “Migrating and Upgrading to Joomla! 1.5”