1.5.0 error in pdf

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
visperas
Posts: 15
Joined: Thu Oct 28, 2004 11:53 am

1.5.0 error in pdf

Post by visperas »

Hi, first of all congratulations for this version.

System Information

phpMyFAQ Version
phpMyFAQ 1.5.0
Server Software
Apache
PHP Version
PHP 4.3.11
PHP Memory Limit
Register Globals
on
Safe Mode
off
Database Client Version
4.0.25
Database Server Version
4.0.25-standard
Webserver Interface
APACHE


when i create a pdf

Warning: Cannot modify header information - headers already sent by (output started at /home/acceso/public_html/phpmyfaq150/font/helveticai.php:30) in /home/acceso/public_html/phpmyfaq150/pdf.php on line 120

Warning: Cannot modify header information - headers already sent by (output started at /home/acceso/public_html/phpmyfaq150/font/helveticai.php:30) in /home/acceso/public_html/phpmyfaq150/pdf.php on line 121

Warning: Cannot modify header information - headers already sent by (output started at /home/acceso/public_html/phpmyfaq150/font/helveticai.php:30) in /home/acceso/public_html/phpmyfaq150/pdf.php on line 122

Warning: Cannot modify header information - headers already sent by (output started at /home/acceso/public_html/phpmyfaq150/font/helveticai.php:30) in /home/acceso/public_html/phpmyfaq150/pdf.php on line 131

Warning: Cannot modify header information - headers already sent by (output started at /home/acceso/public_html/phpmyfaq150/font/helveticai.php:30) in /home/acceso/public_html/phpmyfaq150/pdf.php on line 132

Warning: Cannot modify header information - headers already sent by (output started at /home/acceso/public_html/phpmyfaq150/font/helveticai.php:30) in /home/acceso/public_html/phpmyfaq150/pdf.php on line 133
%PDF-1.3 3 0 obj <> endobj 4 0 obj <> stream xÅ“mPËRÂ0Ã
mrjoel
Posts: 13
Joined: Wed Aug 03, 2005 5:02 pm

Post by mrjoel »

I'm seeing this also 1.4.10 to 1.5 upgrade.
mrjoel
Posts: 13
Joined: Wed Aug 03, 2005 5:02 pm

Post by mrjoel »

As I look at it further the PDF is fully created and I can access it directly by pathname, but the redirect in the new window doesn't appear to work properly (as seen in the error message above) - headers get sent before PDF tries to get sent which screws with the MIME types.
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

I'll take a look at this issue.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
visperas
Posts: 15
Joined: Thu Oct 28, 2004 11:53 am

error in pdf

Post by visperas »

in windows installation works fine

System Information

phpMyFAQ Version
phpMyFAQ 1.5.0
Server Software
Apache/2.0.53 (Win32) mod_ssl/2.0.53 OpenSSL/0.9.7f PHP/5.0.4
PHP Version
PHP 5.0.4
PHP Memory Limit
Register Globals
on
Safe Mode
off
Database Client Version
4.1.7
Database Server Version
4.1.11
Webserver Interface
APACHE2HANDLER
bakabaka
Posts: 15
Joined: Thu Mar 10, 2005 12:45 am
Location: USA
Contact:

Post by bakabaka »

Interesting, it appears that the trailing LF from the font file is causing PHP to throw these errors. Once I modified the fonts/helveticai.php and fonts/helvetica.php files to remove them, the script functions normally when using these fonts. I opened the files in vim and deleted the final "^M" character in the file, which seems to work.

I've observed this behavior under both Linux and MacOS X at this point, and have verified the quick hackish solution under Linux. It appears that the Windows version may expect the final LF to be there in any case.
mrjoel
Posts: 13
Joined: Wed Aug 03, 2005 5:02 pm

Confirmation

Post by mrjoel »

Confirmed fix here as well - thanks for finding that!

I also checked my old 1.4.10 and 1.4.7 installs and they appear to have shipped without the extra LF.

Edit: Note that you need to change all font faces that you use - helveticabi.php if you use bold sans-serif, etc. There is an extra line feed at the end of each line, but removing only the final one is sufficient. This indicates that it was last developed on windows, then copied straight over instead of converting CR/LF entries - also explains why the individual above has no problems on windows.

For a quick (but also correct) fix, run 'dos2unix fonts/*.php fonts/makefont/*.php'
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

you're right. I'll fix all font files for 1.5.1! Thanks a lot!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
visperas
Posts: 15
Joined: Thu Oct 28, 2004 11:53 am

Thanks

Post by visperas »

works fine
Gastongr
Posts: 13
Joined: Mon Jul 19, 2004 12:32 am

Post by Gastongr »

Hello,
this new version is great Thorsten!
I'm having the same problem as you guys but i didn't understand how to fix it. Could someone tell me what to remove?. If i open the file font/helveticai.php with my text editor i can't find any "^M".

Thanks in advance.
Gastongr
Posts: 13
Joined: Mon Jul 19, 2004 12:32 am

Post by Gastongr »

Done, i downloaded vim and saw what you meaned. :)
Thanks again
telenut
Posts: 68
Joined: Thu Sep 09, 2004 10:13 am

Post by telenut »

Can someone post the corrected files here?
They could be made available as patch...

edit:
Seems like you can use the font files of the previous versions of phpmyfaq to solve the problem.
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

the patched files will be included in 1.5.1.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply